Use if let instead of match to fix clippy warning
This commit is contained in:
parent
b4514a8500
commit
d111497a50
|
@ -3897,15 +3897,15 @@ fn fence_gate_collision(facing: Direction, in_wall: bool, open: bool) -> Vec<Aab
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fence_gate_update_state<W: WorldAccess>(world: &W, pos: Position, facing: Direction) -> bool {
|
fn fence_gate_update_state<W: WorldAccess>(world: &W, pos: Position, facing: Direction) -> bool {
|
||||||
match world.get_block(pos.shift(facing.clockwise())) {
|
if let Block::CobblestoneWall{..} = world.get_block(pos.shift(facing.clockwise())) {
|
||||||
Block::CobblestoneWall{..} => return true,
|
return true;
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match world.get_block(pos.shift(facing.counter_clockwise())) {
|
if let Block::CobblestoneWall{..} = world.get_block(pos.shift(facing.counter_clockwise())) {
|
||||||
Block::CobblestoneWall{..} => true,
|
return true;
|
||||||
_ => false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn door_data(facing: Direction, half: DoorHalf, hinge: Side, open: bool, powered: bool) -> Option<usize> {
|
fn door_data(facing: Direction, half: DoorHalf, hinge: Side, open: bool, powered: bool) -> Option<usize> {
|
||||||
|
|
Loading…
Reference in New Issue