Skip to content

Commit a105ff5

Browse files
committed
fix: resolve clippy expect_used and rustfmt rebase artifacts
Replace .expect() with match + tracing::warn on eventfd clone failure in KVM handle_pv_timer_config to satisfy clippy::expect_used lint. Restore combined `use {anyhow, serde_json};` import in error.rs that was split during rebase. Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 7ccb80d commit a105ff5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • src/hyperlight_host/src/hypervisor/virtual_machine/kvm

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,13 @@ impl KvmVm {
259259
fn handle_pv_timer_config(&mut self, data: &[u8]) {
260260
use super::super::x86_64::hw_interrupts::handle_pv_timer_config;
261261

262-
let eventfd_clone = self
263-
.timer_irq_eventfd
264-
.try_clone()
265-
.expect("failed to clone eventfd");
262+
let eventfd_clone = match self.timer_irq_eventfd.try_clone() {
263+
Ok(fd) => fd,
264+
Err(e) => {
265+
tracing::warn!("failed to clone eventfd for timer config: {e}");
266+
return;
267+
}
268+
};
266269
handle_pv_timer_config(&mut self.timer, data, move || {
267270
let _ = eventfd_clone.write(1);
268271
});

0 commit comments

Comments
 (0)