diff --git a/src/position.rs b/src/position.rs index 01ad1c9..3b28e88 100644 --- a/src/position.rs +++ b/src/position.rs @@ -124,7 +124,7 @@ impl Position { moves.len } - /// Discards the optional en passant target square. + /// Discards the en passant target square. /// /// This function is useful to check for position equality, notably when implementing FIDE's /// draw by repetition rules. Note that this function will remove the en passant target square @@ -153,10 +153,9 @@ impl Position { self.0 } - /// Tries to pass the turn to the other color, failing if it would leave the king in check. - /// - /// When possible, this inverts the color to play and removes the en passant square if it - /// exists. + /// Returns the position after after passing the turn to the other color, + /// and `None` if the king in check. On success, this inverts the color to + /// play and discards the en passant square. pub fn pass(&self) -> Option { let setup = &self.0; let blockers = setup.p_b_q | setup.n_b_k | setup.r_q_k;