diff --git a/src/board/bitboard/iterator.rs b/src/board/bitboard/iterator.rs index fcd644c..ea6d489 100644 --- a/src/board/bitboard/iterator.rs +++ b/src/board/bitboard/iterator.rs @@ -11,7 +11,8 @@ impl Iterator for BitboardIterator { } else { let lsb = self.0.trailing_zeros() as usize; self.0 ^= 1 << lsb; - Some(crate::board::Square::from_index(lsb)) + // SAFETY: we know the value is in-bounds + Some(unsafe { crate::board::Square::from_index_unchecked(lsb) }) } }