Implement size_hint() for ByRef iterator

This commit is contained in:
Palmer Cox 2013-12-11 21:37:45 -05:00 committed by “Palmer
parent 2c539d4eec
commit 765bc9064f

View File

@ -795,7 +795,8 @@ pub struct ByRef<'a, T> {
impl<'a, A, T: Iterator<A>> Iterator<A> for ByRef<'a, T> {
#[inline]
fn next(&mut self) -> Option<A> { self.iter.next() }
// FIXME: #9629 we cannot implement &self methods like size_hint on ByRef
#[inline]
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
}
impl<'a, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for ByRef<'a, T> {