From 71ce3f43e00c867eb95f2840641763b5fb230016 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Mon, 20 Sep 2021 04:15:05 -0300 Subject: [PATCH] chore: satisfy clippy --- src/cpu.rs | 5 +---- src/ppu.rs | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cpu.rs b/src/cpu.rs index 6694cbd..a52186b 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -57,10 +57,7 @@ impl Cpu { } pub(crate) fn is_halted(&self) -> bool { - match self.state { - State::Halt(_) => true, - _ => false, - } + matches!(self.state, State::Halt(_)) } pub(crate) fn halt_kind(&self) -> Option { diff --git a/src/ppu.rs b/src/ppu.rs index 51fe9b5..1f166e6 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -261,7 +261,7 @@ impl Ppu { TileLow => { let obj_size = self.ctrl.obj_size(); - let addr = PixelFetcher::get_obj_addr(&attr, &self.pos, obj_size); + let addr = PixelFetcher::get_obj_addr(attr, &self.pos, obj_size); let byte = self.read_byte(addr); self.fetch.obj.tile.with_low_byte(byte); @@ -272,7 +272,7 @@ impl Ppu { TileHigh => { let obj_size = self.ctrl.obj_size(); - let addr = PixelFetcher::get_obj_addr(&attr, &self.pos, obj_size); + let addr = PixelFetcher::get_obj_addr(attr, &self.pos, obj_size); let byte = self.read_byte(addr + 1); self.fetch.obj.tile.with_high_byte(byte);