From: Zhao Liu Date: Mon, 14 Apr 2025 14:49:43 +0000 (+0800) Subject: rust/hpet: Fix a clippy error X-Git-Tag: v10.1.0-rc0~120^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad3ab01bb7380f8cc8cf86dd260ce751148d6d21;p=thirdparty%2Fqemu.git rust/hpet: Fix a clippy error 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 Link: https://lore.kernel.org/r/20250414144943.1112885-10-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- diff --git a/rust/hw/timer/hpet/src/hpet.rs b/rust/hw/timer/hpet/src/hpet.rs index dc8a23f29d9..cbd2ed4f6bf 100644 --- a/rust/hw/timer/hpet/src/hpet.rs +++ b/rust/hw/timer/hpet/src/hpet.rs @@ -353,7 +353,7 @@ impl HPETTimer { // 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(self.index.into(), set && self.is_int_level_triggered()); self.set_irq(set); }