Skip to content

Commit ac8d8d1

Browse files
committed
remove unnecessary if let
1 parent e877f33 commit ac8d8d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/board.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ impl Board {
955955
if moved == Piece::Knight {
956956
result.checkers ^= get_knight_moves(ksq) & dest_bb;
957957
} else if moved == Piece::Pawn {
958-
if let Some(Piece::Knight) = m.get_promotion() {
958+
if matches!(m.get_promotion(), Some(Piece::Knight)) {
959959
result.xor(Piece::Pawn, dest_bb, self.side_to_move);
960960
result.xor(Piece::Knight, dest_bb, self.side_to_move);
961961
result.checkers ^= get_knight_moves(ksq) & dest_bb;

0 commit comments

Comments
 (0)