1
0
Fork 0

update docs

This commit is contained in:
Paul-Nicolas Madelaine 2025-11-18 06:49:33 +01:00
parent 671ff331d3
commit b45952b6b7
5 changed files with 47 additions and 43 deletions

View file

@ -31,16 +31,16 @@ use core::ops::ControlFlow;
/// be applied unambiguously or when doing so enables some code optimisation. See
/// [`IllegalPositionReason`] for details about rejected positions.
///
/// ## Move generation & play
/// ## Move generation & Play
///
/// The [`legal_moves`](Position::legal_moves) method generates the list of all legal moves on the
/// position. [`UciMove::to_move`] and [`San::to_move`] can also be used to convert chess notation
/// to playable moves.
///
/// Playing a move is done through a copy-make interface. [`legal_moves`](Position::legal_moves)
/// returns a sequence of [`Move`] objects. Moves hold a reference to the position from where they
/// were computed. They can be played without further checks and without potential panics using
/// [`Move::make`].
/// returns a sequence of [`Move<'l>`](Move) objects. Moves hold a reference to the position
/// from where they were computed. They can be played without further checks and without potential
/// panics using [`Move::make`].
///
/// ## En passant & Equality
///
@ -197,10 +197,9 @@ impl Position {
/// 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
/// even if taking en passant is legal. If this is not desirable, it is the caller's
/// responsibility to rule out the legality of en passant before calling this function.
/// This function will remove the en passant target square even if taking en passant is legal.
/// If this is not desirable, it is the caller's responsibility to rule out the legality of en
/// passant before calling this function.
#[inline]
pub fn remove_en_passant_target_square(&mut self) {
self.0.en_passant = OptionSquare::None;