MoveGenerator::iter() returns an iterator of moves-by-value

This commit is contained in:
Eryn Wells 2024-01-28 15:59:16 -08:00
parent ea22f7c5c7
commit 83a4e47e56

View file

@ -57,7 +57,7 @@ macro_rules! move_generator_declaration {
};
($name:ident, getters) => {
impl $name {
pub(super) fn iter(&self) -> impl Iterator<Item = &$crate::Move> + '_ {
pub(super) fn iter(&self) -> impl Iterator<Item = $crate::Move> + '_ {
self.move_sets.values().map(|set| set.moves()).flatten()
}
@ -141,7 +141,6 @@ impl Moves {
.chain(self.rook_moves.iter())
.chain(self.queen_moves.iter())
.chain(self.king_moves.iter())
.cloned()
}
}