MoveGenerator::iter() returns an iterator of moves-by-value
This commit is contained in:
parent
ea22f7c5c7
commit
83a4e47e56
1 changed files with 1 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue