From 8b8b2b17a2b66cbde222793d018e42f00a25bbf1 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Fri, 25 Jun 2021 21:40:25 +0100 Subject: [PATCH] change to using iter --- agb/src/interrupt.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 60d15704..59bfa3c0 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -94,9 +94,8 @@ static mut INTERRUPT_TABLE: [InterruptRoot; 14] = [ #[no_mangle] pub extern "C" fn __RUST_INTERRUPT_HANDLER(interrupt: u16) { - for i in 0..=13_u16 { + for (i, root) in unsafe { INTERRUPT_TABLE.iter().enumerate() } { if (1 << i) & interrupt != 0 { - let root = unsafe { &INTERRUPT_TABLE[i as usize] }; root.trigger_interrupts(); } }