@@ -1088,10 +1088,7 @@ impl<'a, I> DoubleEndedIterator for ByRef<'a, I> where I: 'a + DoubleEndedIterat
1088
1088
}
1089
1089
1090
1090
#[ stable]
1091
- impl < ' a , I > ExactSizeIterator for ByRef < ' a , I > where I : ' a + ExactSizeIterator {
1092
- #[ inline]
1093
- fn len ( & self ) -> uint { self . iter . len ( ) }
1094
- }
1091
+ impl < ' a , I > ExactSizeIterator for ByRef < ' a , I > where I : ' a + ExactSizeIterator { }
1095
1092
1096
1093
/// A trait for iterators over elements which can be added together
1097
1094
#[ unstable = "needs to be re-evaluated as part of numerics reform" ]
@@ -1797,14 +1794,7 @@ impl<T, I> Iterator for Peekable<T, I> where I: Iterator<Item=T> {
1797
1794
}
1798
1795
1799
1796
#[ stable]
1800
- impl < T , I > ExactSizeIterator for Peekable < T , I > where I : ExactSizeIterator < Item = T > {
1801
- #[ inline]
1802
- fn len ( & self ) -> usize {
1803
- // This is guarenteed to not overflow because `len()` must have been able to return a valid
1804
- // value before we peeked.
1805
- self . iter . len ( ) + if self . peeked . is_some ( ) { 1 } else { 0 }
1806
- }
1807
- }
1797
+ impl < T , I > ExactSizeIterator for Peekable < T , I > where I : ExactSizeIterator < Item = T > { }
1808
1798
1809
1799
#[ stable]
1810
1800
impl < T , I > Peekable < T , I > where I : Iterator < Item =T > {
@@ -1999,10 +1989,7 @@ impl<I> RandomAccessIterator for Skip<I> where I: RandomAccessIterator{
1999
1989
}
2000
1990
2001
1991
#[ stable]
2002
- impl < I > ExactSizeIterator for Skip < I > where I : ExactSizeIterator {
2003
- #[ inline]
2004
- fn len ( & self ) -> uint { self . iter . len ( ) . saturating_sub ( self . n ) }
2005
- }
1992
+ impl < I > ExactSizeIterator for Skip < I > where I : ExactSizeIterator { }
2006
1993
2007
1994
/// An iterator that only iterates over the first `n` iterations of `iter`.
2008
1995
#[ derive( Clone ) ]
@@ -2060,10 +2047,7 @@ impl<I> RandomAccessIterator for Take<I> where I: RandomAccessIterator{
2060
2047
}
2061
2048
2062
2049
#[ stable]
2063
- impl < I > ExactSizeIterator for Take < I > where I : ExactSizeIterator {
2064
- #[ inline]
2065
- fn len ( & self ) -> uint { cmp:: min ( self . iter . len ( ) , self . n ) }
2066
- }
2050
+ impl < I > ExactSizeIterator for Take < I > where I : ExactSizeIterator { }
2067
2051
2068
2052
2069
2053
/// An iterator to maintain state while iterating another iterator
@@ -2275,10 +2259,7 @@ impl<I> RandomAccessIterator for Fuse<I> where I: RandomAccessIterator {
2275
2259
}
2276
2260
2277
2261
#[ stable]
2278
- impl < I > ExactSizeIterator for Fuse < I > where I : ExactSizeIterator {
2279
- #[ inline]
2280
- fn len ( & self ) -> uint { self . iter . len ( ) }
2281
- }
2262
+ impl < I > ExactSizeIterator for Fuse < I > where I : ExactSizeIterator { }
2282
2263
2283
2264
impl < I > Fuse < I > {
2284
2265
/// Resets the fuse such that the next call to .next() or .next_back() will
0 commit comments