From 58b8dc897e1d6ba26e03c2a18e56c17ec2e7a897 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Sat, 2 Mar 2019 15:28:28 +0100 Subject: [PATCH] Implement `FusedIterator` for `Drain` and `IntoIter` --- lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib.rs b/lib.rs index 4b869e0..5db9762 100644 --- a/lib.rs +++ b/lib.rs @@ -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; @@ -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) { @@ -1506,6 +1507,7 @@ impl DoubleEndedIterator for IntoIter { } impl ExactSizeIterator for IntoIter { } +impl FusedIterator for IntoIter { } impl IntoIterator for SmallVec { type IntoIter = IntoIter;