1
0
Fork 0
This commit is contained in:
Paul-Nicolas Madelaine 2025-10-19 15:01:42 +02:00
parent 494de58804
commit 5f1bc22797

View file

@ -213,7 +213,7 @@ impl Rank {
#[inline] #[inline]
pub fn mirror(self) -> Self { pub fn mirror(self) -> Self {
unsafe { Self::new_unchecked(7_u8.unchecked_sub(self as u8)) } unsafe { Self::new_unchecked(!(self as u8)) }
} }
#[inline] #[inline]
@ -305,7 +305,8 @@ impl Square {
#[inline] #[inline]
pub fn mirror(self) -> Self { pub fn mirror(self) -> Self {
Self::from_coords(self.file(), self.rank().mirror()) let sq = self as u8;
unsafe { Self::new_unchecked(sq & 0b000111 | (!sq & 0b111000)) }
} }
#[inline] #[inline]