Skip to content

Commit

Permalink
Implement FusedIterator for Drain and IntoIter
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Mar 2, 2019
1 parent dfd78d1 commit 58b8dc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use std::borrow::{Borrow, BorrowMut};
use std::cmp;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::iter::{IntoIterator, FromIterator, repeat};
use std::iter::{IntoIterator, FromIterator, FusedIterator, repeat};
use std::mem;
use std::mem::ManuallyDrop;
use std::ops;
Expand Down Expand Up @@ -266,6 +266,7 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
}

impl<'a, T> ExactSizeIterator for Drain<'a, T> { }
impl<'a, T> FusedIterator for Drain<'a, T> { }

impl<'a, T: 'a> Drop for Drain<'a,T> {
fn drop(&mut self) {
Expand Down Expand Up @@ -1506,6 +1507,7 @@ impl<A: Array> DoubleEndedIterator for IntoIter<A> {
}

impl<A: Array> ExactSizeIterator for IntoIter<A> { }
impl<A: Array> FusedIterator for IntoIter<A> { }

impl<A: Array> IntoIterator for SmallVec<A> {
type IntoIter = IntoIter<A>;
Expand Down

0 comments on commit 58b8dc8

Please sign in to comment.