From 882ffa9e8fffd5f2aa2791058ae94bc0eb78eb6d Mon Sep 17 00:00:00 2001 From: Paul-Nicolas Madelaine Date: Thu, 13 Nov 2025 23:10:22 +0100 Subject: [PATCH] docs --- src/position.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;