Skip to content

Commit

Permalink
Impl IntoIterator for &mut Vector<A> (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carnagion authored Jun 23, 2024
1 parent e5770e2 commit 38699a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1986,6 +1986,14 @@ impl<'a, A> IntoIterator for &'a Vector<A> {
}
}

impl<'a, A: Clone> IntoIterator for &'a mut Vector<A> {
type Item = &'a mut A;
type IntoIter = IterMut<'a, A>;
fn into_iter(self) -> Self::IntoIter {
self.iter_mut()
}
}

impl<A: Clone> IntoIterator for Vector<A> {
type Item = A;
type IntoIter = ConsumingIter<A>;
Expand Down

0 comments on commit 38699a7

Please sign in to comment.