From d111497a50a3cf58b6039e995778f1350b1e19dc Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 4 Nov 2018 14:38:27 -0800 Subject: [PATCH] Use if let instead of match to fix clippy warning --- blocks/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index 2e8ff79..fbb9a68 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -3897,15 +3897,15 @@ fn fence_gate_collision(facing: Direction, in_wall: bool, open: bool) -> Vec(world: &W, pos: Position, facing: Direction) -> bool { - match world.get_block(pos.shift(facing.clockwise())) { - Block::CobblestoneWall{..} => return true, - _ => (), + if let Block::CobblestoneWall{..} = world.get_block(pos.shift(facing.clockwise())) { + return true; } - match world.get_block(pos.shift(facing.counter_clockwise())) { - Block::CobblestoneWall{..} => true, - _ => false, + if let Block::CobblestoneWall{..} = world.get_block(pos.shift(facing.counter_clockwise())) { + return true; } + + false } fn door_data(facing: Direction, half: DoorHalf, hinge: Side, open: bool, powered: bool) -> Option {