Skip to content

Commit 58b8dc8

Browse files
committed
Implement FusedIterator for Drain and IntoIter
1 parent dfd78d1 commit 58b8dc8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use std::borrow::{Borrow, BorrowMut};
5555
use std::cmp;
5656
use std::fmt;
5757
use std::hash::{Hash, Hasher};
58-
use std::iter::{IntoIterator, FromIterator, repeat};
58+
use std::iter::{IntoIterator, FromIterator, FusedIterator, repeat};
5959
use std::mem;
6060
use std::mem::ManuallyDrop;
6161
use std::ops;
@@ -266,6 +266,7 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
266266
}
267267

268268
impl<'a, T> ExactSizeIterator for Drain<'a, T> { }
269+
impl<'a, T> FusedIterator for Drain<'a, T> { }
269270

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

15081509
impl<A: Array> ExactSizeIterator for IntoIter<A> { }
1510+
impl<A: Array> FusedIterator for IntoIter<A> { }
15091511

15101512
impl<A: Array> IntoIterator for SmallVec<A> {
15111513
type IntoIter = IntoIter<A>;

0 commit comments

Comments
 (0)