@samitouri / QOSamiQemu / commits / 3a87bc9f07

rust: hpet: fix clippy needless_range_loop

Nightly clippy is a bit smarter and recognizes one more loop that it wants to be written with iterators. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo Bonzini committed Aug 25, 2026 at 15:39 UTC 3a87bc9f07aece1944e21d86a8f1bbaf1251f132
1 file changed +1 -3
rust/hw/timer/hpet/src/device.rs
+1 -3
@@ -938,9 +938,7 @@ impl HPETState {
938 let mut regs = self.regs.borrow_mut();
939 let cnt = regs.counter;
940
941 - for index in 0..self.num_timers {
942 - let tn_regs = &mut regs.tn_regs[index];
943 -
941 + for tn_regs in regs.tn_regs.iter_mut().take(self.num_timers) {
942 tn_regs.update_cmp64(cnt);
943 tn_regs.last = CLOCK_VIRTUAL.get_ns() - NANOSECONDS_PER_SECOND;
944 }