Skip to content

Commit 765bc90

Browse files
Palmer Cox“Palmer
Palmer Cox
authored and
“Palmer
committed
Implement size_hint() for ByRef iterator
1 parent 2c539d4 commit 765bc90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libstd/iter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,8 @@ pub struct ByRef<'a, T> {
795795
impl<'a, A, T: Iterator<A>> Iterator<A> for ByRef<'a, T> {
796796
#[inline]
797797
fn next(&mut self) -> Option<A> { self.iter.next() }
798-
// FIXME: #9629 we cannot implement &self methods like size_hint on ByRef
798+
#[inline]
799+
fn size_hint(&self) -> (uint, Option<uint>) { self.iter.size_hint() }
799800
}
800801

801802
impl<'a, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for ByRef<'a, T> {

0 commit comments

Comments
 (0)