1
0
Fork 0
This commit is contained in:
Paul-Nicolas Madelaine 2025-11-29 14:12:20 +01:00
parent 5d9ac032dd
commit f97a594635

View file

@ -20,6 +20,7 @@ pub struct Move<'l> {
} }
impl<'l> Move<'l> { impl<'l> Move<'l> {
#[inline]
pub(crate) unsafe fn new_unchecked(position: &'l Position, raw: RawMove) -> Self { pub(crate) unsafe fn new_unchecked(position: &'l Position, raw: RawMove) -> Self {
Self { position, raw } Self { position, raw }
} }
@ -28,6 +29,7 @@ impl<'l> Move<'l> {
/// ///
/// This sets the en passant square after a double pawn advance, even when there is no pawn to /// This sets the en passant square after a double pawn advance, even when there is no pawn to
/// capture or when capturing is not legal. /// capture or when capturing is not legal.
#[inline]
pub fn make(self) -> Position { pub fn make(self) -> Position {
let mut position = self.position.clone(); let mut position = self.position.clone();
unsafe { position.play_unchecked(self.raw) }; unsafe { position.play_unchecked(self.raw) };