From 25b656f2bc2e37d78283cb51c7f3a8bcdb0a6c14 Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Sun, 5 Nov 2023 23:11:23 +0100 Subject: [PATCH] Remove a few clippy warnings --- src/decoder_8080.rs | 2 +- src/decoder_z80.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/decoder_8080.rs b/src/decoder_8080.rs index 79b2ddc..aa28d0d 100644 --- a/src/decoder_8080.rs +++ b/src/decoder_8080.rs @@ -163,7 +163,7 @@ impl Decoder8080 { // Load cycle information for c in 0..=255 { - if let Some(opcode) = &mut self.no_prefix[c as usize] { + if let Some(opcode) = &mut self.no_prefix[c] { opcode.cycles = NO_PREFIX_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } diff --git a/src/decoder_z80.rs b/src/decoder_z80.rs index 7f479ee..8821909 100644 --- a/src/decoder_z80.rs +++ b/src/decoder_z80.rs @@ -413,20 +413,20 @@ impl DecoderZ80 { // Load cycle information for c in 0..=255 { - if let Some(opcode) = &mut self.no_prefix[c as usize] { + if let Some(opcode) = &mut self.no_prefix[c] { opcode.cycles = NO_PREFIX_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_cb[c as usize] { + if let Some(opcode) = &mut self.prefix_cb[c] { opcode.cycles = PREFIX_CB_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_cb_indexed[c as usize] { + if let Some(opcode) = &mut self.prefix_cb_indexed[c] { // 23 cycles except for BIT that is 20 opcode.cycles = if (c & 0xc0) == 0x40 {20} else {23}; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_ed[c as usize] { + if let Some(opcode) = &mut self.prefix_ed[c] { opcode.cycles = PREFIX_ED_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; }