Refactor some clippy-pedantic errors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
_ => (),
|
||||
|
||||
Reference in New Issue
Block a user