From 85ac65408fee5da9c8cf6359d14e731ae74eb195 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 6 Apr 2024 12:50:31 +0100 Subject: [PATCH] Remove unused 'en_passant_origins' I don't think I'll need it after all. --- src/movegen/naive/pawn.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/movegen/naive/pawn.rs b/src/movegen/naive/pawn.rs index bde5215..c27f743 100644 --- a/src/movegen/naive/pawn.rs +++ b/src/movegen/naive/pawn.rs @@ -38,17 +38,6 @@ pub fn pawn_captures(color: Color, square: Square) -> Bitboard { attack_west | attack_east } -/// Computes the set of squares that can capture this one *en-passant*. -#[allow(unused)] -pub fn en_passant_origins(square: Square) -> Bitboard { - let board = square.into_bitboard(); - - let origin_west = Direction::West.move_board(board); - let origin_east = Direction::East.move_board(board); - - origin_west | origin_east -} - #[cfg(test)] mod test { use super::*; @@ -124,14 +113,4 @@ mod test { Square::G6.into_bitboard() ); } - - #[test] - fn en_passant() { - assert_eq!(en_passant_origins(Square::A4), Square::B4.into_bitboard()); - assert_eq!(en_passant_origins(Square::A5), Square::B5.into_bitboard()); - assert_eq!(en_passant_origins(Square::B4), Square::A4 | Square::C4); - assert_eq!(en_passant_origins(Square::B5), Square::A5 | Square::C5); - assert_eq!(en_passant_origins(Square::H4), Square::G4.into_bitboard()); - assert_eq!(en_passant_origins(Square::H5), Square::G5.into_bitboard()); - } }