From d7529387ea672204aba1565d7e82a11b82b83697 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 19 Jul 2020 09:45:46 +0100 Subject: [PATCH] don't allow duplicate tiles with different names --- src/tile.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tile.rs b/src/tile.rs index dbcf6fe..7ad36c4 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -12,8 +12,6 @@ pub struct Tile { impl PartialEq for Tile { fn eq(&self, other: &Self) -> bool { - self.name == other.name - && self.wall == other.wall && self.animation_frames == other.animation_frames @@ -144,5 +142,7 @@ mod test { let mut tile_b = crate::mock::tile_default(); tile_b.id = "0".to_string(); assert_eq!(tile_a, tile_b); + tile_b.name = None; + assert_eq!(tile_a, tile_b); } }