Refactor some clippy-pedantic errors

This commit is contained in:
stefiosif
2024-09-06 20:30:57 +03:00
parent 6b9650a6f0
commit 2093d91dfa
12 changed files with 42 additions and 47 deletions

View File

@@ -349,7 +349,7 @@ fn king_castling_moves(board: &Board, color: Color, all_occupancies: Bitboard) -
let mut add_move_if_empty_path = |path_mask, king_dst| {
if !have_common_bit(all_occupancies, path_mask) {
moves.push(Move::new_with_type(king_src, king_dst, MoveType::Castle))
moves.push(Move::new_with_type(king_src, king_dst, MoveType::Castle));
}
};
@@ -362,14 +362,10 @@ fn king_castling_moves(board: &Board, color: Color, all_occupancies: Bitboard) -
add_move_if_empty_path(path_long, king_dst_long);
}
(Castle::Both, Castle::Short)
| (Castle::Short, Castle::Short)
| (Castle::Short, Castle::Both) => {
(Castle::Both | Castle::Short, Castle::Short) | (Castle::Short, Castle::Both) => {
add_move_if_empty_path(path_short, king_dst_short);
}
(Castle::Both, Castle::Long)
| (Castle::Long, Castle::Long)
| (Castle::Long, Castle::Both) => {
(Castle::Both | Castle::Long, Castle::Long) | (Castle::Long, Castle::Both) => {
add_move_if_empty_path(path_long, king_dst_long);
}
_ => (),