From a5a6426e72fca06627ad64c187aeebb35875379f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Tue, 6 Dec 2022 18:11:26 +0000 Subject: [PATCH] fix: solved some clippy issues --- src/ppu.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ppu.rs b/src/ppu.rs index 2272130a..bd680076 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -99,7 +99,7 @@ impl Display for Tile { } buffer.push('\n'); } - write!(f, "{}", buffer) + write!(f, "{buffer}") } } @@ -669,9 +669,9 @@ impl Ppu { /// with tiles. fn update_tile(&mut self, addr: u16, _value: u8) { let addr = (addr & 0x1ffe) as usize; - let tile_index = ((addr >> 4) & 0x01ff) as usize; + let tile_index = (addr >> 4) & 0x01ff; let tile = self.tiles[tile_index].borrow_mut(); - let y = ((addr >> 1) & 0x0007) as usize; + let y = (addr >> 1) & 0x0007; let mut mask; @@ -758,7 +758,7 @@ impl Ppu { // increments the map offset by the row offset multiplied by the number // of tiles in each row (32) - map_offset += row_offset as usize * 32; + map_offset += row_offset * 32; // calculates the sprite line offset by using the SCX register // shifted by 3 meaning that the tiles are 8x8 -- GitLab