[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 9/9] rust/hpet: Fix a clippy error
From: |
Zhao Liu |
Subject: |
[PATCH 9/9] rust/hpet: Fix a clippy error |
Date: |
Mon, 14 Apr 2025 22:49:43 +0800 |
Carge clippy complained about:
error: casts from `u8` to `u32` can be expressed infallibly using `From`
So use `From` to convert `u8` to `u32`.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
rust/hw/timer/hpet/src/hpet.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/hw/timer/hpet/src/hpet.rs b/rust/hw/timer/hpet/src/hpet.rs
index 983f3882f8d3..a3538af14b48 100644
--- a/rust/hw/timer/hpet/src/hpet.rs
+++ b/rust/hw/timer/hpet/src/hpet.rs
@@ -357,7 +357,7 @@ fn update_irq(&mut self, set: bool) {
// still operate and generate appropriate status bits, but
// will not cause an interrupt"
self.get_state()
- .update_int_status(self.index as u32, set &&
self.is_int_level_triggered());
+ .update_int_status(u32::from(self.index), set &&
self.is_int_level_triggered());
self.set_irq(set);
}
--
2.34.1
- [PATCH 3/9] rust/vmstate_test: Test varray with num field wrapped in BqlCell, (continued)
[PATCH 7/9] rust/hpet: convert HPETTimer index to u8 type, Zhao Liu, 2025/04/14
[PATCH 9/9] rust/hpet: Fix a clippy error,
Zhao Liu <=
Re: [PATCH 0/9] rust/hpet: Initial support for migration, Paolo Bonzini, 2025/04/15