From 20cb9f88faec81ccf824daf8ec945bc48b47d898 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 26 Jan 2022 18:45:54 -0500 Subject: [PATCH] Fix warnings --- src/components/position.rs | 2 +- src/map.rs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/position.rs b/src/components/position.rs index 7263675..919ab1d 100644 --- a/src/components/position.rs +++ b/src/components/position.rs @@ -10,6 +10,6 @@ pub struct Position { impl PartialEq for Position { fn eq(&self, other: &Point) -> bool { - return self.x == other.x && self.y == other.y; + self.x == other.x && self.y == other.y } } diff --git a/src/map.rs b/src/map.rs index 25aa327..87045de 100644 --- a/src/map.rs +++ b/src/map.rs @@ -125,10 +125,9 @@ impl Map { } pub fn is_solid(&self, point: Point) -> bool { - match self.get_tile_at(point) { - TileType::Wall => true, - TileType::BreakableWall => true, - _ => false, - } + matches!( + self.get_tile_at(point), + TileType::Wall | TileType::BreakableWall + ) } }