diff --git a/src/libcore/iter/mod.rs b/src/libcore/iter/mod.rs index 03369d6c8f3fd..33e7e919d5870 100644 --- a/src/libcore/iter/mod.rs +++ b/src/libcore/iter/mod.rs @@ -415,19 +415,25 @@ impl Iterator for Rev where I: DoubleEndedIterator { type Item = ::Item; #[inline] - fn next(&mut self) -> Option<::Item> { self.iter.next_back() } + fn next(&mut self) -> Option { self.iter.next_back() } #[inline] fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } + #[inline] + fn count(self) -> usize { self.iter.count() } + #[inline] + fn last(mut self) -> Option { self.iter.next() } #[inline] - fn nth(&mut self, n: usize) -> Option<::Item> { self.iter.nth_back(n) } + fn nth(&mut self, n: usize) -> Option { self.iter.nth_back(n) } + #[inline] fn try_fold(&mut self, init: B, f: F) -> R where Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try { self.iter.try_rfold(init, f) } + #[inline] fn fold(self, init: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc, { @@ -452,23 +458,26 @@ impl Iterator for Rev where I: DoubleEndedIterator { #[stable(feature = "rust1", since = "1.0.0")] impl DoubleEndedIterator for Rev where I: DoubleEndedIterator { #[inline] - fn next_back(&mut self) -> Option<::Item> { self.iter.next() } + fn next_back(&mut self) -> Option { self.iter.next() } #[inline] - fn nth_back(&mut self, n: usize) -> Option<::Item> { self.iter.nth(n) } + fn nth_back(&mut self, n: usize) -> Option { self.iter.nth(n) } + #[inline] fn try_rfold(&mut self, init: B, f: F) -> R where Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try { self.iter.try_fold(init, f) } + #[inline] fn rfold(self, init: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc, { self.iter.fold(init, f) } + #[inline] fn rfind

(&mut self, predicate: P) -> Option where P: FnMut(&Self::Item) -> bool { @@ -480,10 +489,12 @@ impl DoubleEndedIterator for Rev where I: DoubleEndedIterator { impl ExactSizeIterator for Rev where I: ExactSizeIterator + DoubleEndedIterator { + #[inline] fn len(&self) -> usize { self.iter.len() } + #[inline] fn is_empty(&self) -> bool { self.iter.is_empty() }