Skip to content

Commit 5d77fbd

Browse files
committed
fix: rustfmt and clippy fixes (import ordering, unused Debug import)
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 5fb05d5 commit 5d77fbd

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

src/hyperlight_host/src/hypervisor/virtual_machine/kvm.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
#[cfg(feature = "hw-interrupts")]
18+
use std::sync::Arc;
1719
use std::sync::LazyLock;
1820
#[cfg(feature = "hw-interrupts")]
1921
use std::sync::atomic::{AtomicBool, Ordering};
20-
#[cfg(feature = "hw-interrupts")]
21-
use std::sync::Arc;
2222

2323
use hyperlight_common::outb::OutBAction;
2424
#[cfg(gdb)]
@@ -154,10 +154,11 @@ impl KvmVm {
154154
// When the timer thread writes to this EventFd, the in-kernel
155155
// PIC will assert IRQ0, which is delivered as the vector the
156156
// guest configured during PIC remap (typically vector 0x20).
157-
let eventfd = EventFd::new(0)
158-
.map_err(|e| CreateVmError::InitializeVm(
159-
kvm_ioctls::Error::new(e.raw_os_error().unwrap_or(libc::EIO)).into()
160-
))?;
157+
let eventfd = EventFd::new(0).map_err(|e| {
158+
CreateVmError::InitializeVm(
159+
kvm_ioctls::Error::new(e.raw_os_error().unwrap_or(libc::EIO)).into(),
160+
)
161+
})?;
161162
vm_fd
162163
.register_irqfd(&eventfd, 0)
163164
.map_err(|e| CreateVmError::InitializeVm(e.into()))?;
@@ -267,9 +268,8 @@ impl VirtualMachine for KvmVm {
267268
// The guest is configuring the timer period.
268269
// Extract the period in microseconds (LE u32).
269270
if data.len() >= 4 {
270-
let period_us = u32::from_le_bytes(
271-
data[..4].try_into().unwrap(),
272-
) as u64;
271+
let period_us =
272+
u32::from_le_bytes(data[..4].try_into().unwrap()) as u64;
273273
if period_us > 0 && self.timer_thread.is_none() {
274274
let eventfd = self
275275
.timer_irq_eventfd

src/hyperlight_host/src/hypervisor/virtual_machine/mshv.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
#[cfg(gdb)]
18-
use std::fmt::Debug;
1917
#[cfg(feature = "hw-interrupts")]
2018
use std::sync::Arc;
2119
use std::sync::LazyLock;

src/hyperlight_host/tests/integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,4 +1792,4 @@ fn hw_timer_interrupts() {
17921792
"Expected at least one timer interrupt, got {count}"
17931793
);
17941794
});
1795-
}
1795+
}

0 commit comments

Comments
 (0)