diff --git a/src/chess/moves.rs b/src/chess/moves.rs index 9a1c5911..2c7d66fa 100644 --- a/src/chess/moves.rs +++ b/src/chess/moves.rs @@ -62,18 +62,6 @@ impl Move { } } -impl From<(Square, Square)> for Move { - fn from((src, dst): (Square, Square)) -> Self { - Self::new(src, dst) - } -} - -impl From<(Square, Square, PromotionPieceKind)> for Move { - fn from((src, dst, promotion): (Square, Square, PromotionPieceKind)) -> Self { - Self::new_with_promotion(src, dst, promotion) - } -} - impl std::fmt::Debug for Move { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( diff --git a/src/engine/search/move_picker.rs b/src/engine/search/move_picker.rs index 3ee5a200..a17f402b 100644 --- a/src/engine/search/move_picker.rs +++ b/src/engine/search/move_picker.rs @@ -273,7 +273,7 @@ mod tests { let game = Game::new(); let mut moves: Vec = Vec::new(); - let mut move_picker = MovePicker::new(Some((G1, F3).into())); + let mut move_picker = MovePicker::new(Some(Move::new(G1, F3))); let search_state = SearchState::new(); let persistent_state = PersistentState::new(16); diff --git a/src/engine/see.rs b/src/engine/see.rs index 9f419404..de7ddb27 100644 --- a/src/engine/see.rs +++ b/src/engine/see.rs @@ -141,22 +141,26 @@ pub fn see(game: &Game, mv: Move, threshold: Eval) -> bool { mod tests { use super::*; use crate::chess::game::Game; + use crate::chess::moves::MoveListExt; use crate::chess::square::squares::all::*; + use crate::chess::square::Square; - fn should_be_good_capture(fen: &str, mv: impl Into) { + fn should_be_good_capture(fen: &str, mv: (Square, Square)) { crate::init(); let game = Game::from_fen(fen).unwrap(); + let mv = game.moves().expect_matching(mv.0, mv.1, None); - assert!(see(&game, mv.into(), Eval(0))); + assert!(see(&game, mv, Eval(0))); } - fn should_be_bad_capture(fen: &str, mv: impl Into) { + fn should_be_bad_capture(fen: &str, mv: (Square, Square)) { crate::init(); let game = Game::from_fen(fen).unwrap(); + let mv = game.moves().expect_matching(mv.0, mv.1, None); - assert!(!see(&game, mv.into(), Eval(0))); + assert!(!see(&game, mv, Eval(0))); } #[test]