From 106ad5fed5de085e5da71b12bbb39b68d8be195f Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 5 Mar 2022 18:25:28 +0000 Subject: [PATCH] Fix clippy lints for hat-chooses-wizard --- examples/the-hat-chooses-the-wizard/build.rs | 12 ++++++------ examples/the-hat-chooses-the-wizard/src/main.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/the-hat-chooses-the-wizard/build.rs b/examples/the-hat-chooses-the-wizard/build.rs index 5b385333..bf20316e 100644 --- a/examples/the-hat-chooses-the-wizard/build.rs +++ b/examples/the-hat-chooses-the-wizard/build.rs @@ -174,14 +174,14 @@ mod tiled_export { pub const fn get_level() -> Level {{ Level {{ - background: &TILEMAP, - foreground: &BACKGROUND, + background: TILEMAP, + foreground: BACKGROUND, dimensions: Vector2D {{x: WIDTH, y: HEIGHT}}, - collision: &crate::map_tiles::tilemap::TILE_DATA, + collision: crate::map_tiles::tilemap::TILE_DATA, - enemy_stops: &ENEMY_STOPS, - slimes: &SLIMES, - snails: &SNAILS, + enemy_stops: ENEMY_STOPS, + slimes: SLIMES, + snails: SNAILS, start_pos: START_POS, }} }} diff --git a/examples/the-hat-chooses-the-wizard/src/main.rs b/examples/the-hat-chooses-the-wizard/src/main.rs index 75f24596..589db875 100644 --- a/examples/the-hat-chooses-the-wizard/src/main.rs +++ b/examples/the-hat-chooses-the-wizard/src/main.rs @@ -19,7 +19,7 @@ pub struct Level { } mod object_tiles { - pub const WIZARD_TILE_START: u16 = 0 * 4; + pub const WIZARD_TILE_START: u16 = 0; pub const WIZARD_JUMP: u16 = 4 * 4; pub const WIZARD_FALL_START: u16 = 5 * 4; @@ -504,7 +504,7 @@ impl<'a> Player<'a> { let hat_base_tile = match self.num_recalls { 0 => object_tiles::HAT_TILE_START, 1 => object_tiles::HAT_TILE_START_SECOND, - 2 | _ => object_tiles::HAT_TILE_START_THIRD, + _ => object_tiles::HAT_TILE_START_THIRD, }; match self.facing { @@ -540,7 +540,7 @@ impl<'a> Player<'a> { let hat_sprite_divider = match self.num_recalls { 0 => 1, 1 => 2, - 2 | _ => 4, + _ => 4, }; let hat_sprite_offset = timer / hat_sprite_divider % 10;