diff --git a/src/board/bitboard/iterator.rs b/src/board/bitboard/iterator.rs index 06db283..fcd644c 100644 --- a/src/board/bitboard/iterator.rs +++ b/src/board/bitboard/iterator.rs @@ -14,4 +14,14 @@ impl Iterator for BitboardIterator { Some(crate::board::Square::from_index(lsb)) } } + + fn size_hint(&self) -> (usize, Option) { + let size = self.0.count_ones() as usize; + + (size, Some(size)) + } } + +impl ExactSizeIterator for BitboardIterator {} + +impl std::iter::FusedIterator for BitboardIterator {}