Skip to content

Commit

Permalink
also forward Iterator::size_hint()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Jan 20, 2015
1 parent 74e111c commit 00cddb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/liballoc/boxed.rs
Expand Up @@ -194,6 +194,10 @@ impl<'a, T> Iterator for Box<Iterator<Item=T> + 'a> {
fn next(&mut self) -> Option<T> {
(**self).next()
}

fn size_hint(&self) -> (usize, Option<usize>) {
(**self).size_hint()
}
}

#[cfg(test)]
Expand Down
4 changes: 4 additions & 0 deletions src/libcore/iter.rs
Expand Up @@ -107,6 +107,10 @@ impl<'a, T> Iterator for &'a mut (Iterator<Item=T> + 'a) {
fn next(&mut self) -> Option<T> {
(**self).next()
}

fn size_hint(&self) -> (usize, Option<usize>) {
(**self).size_hint()
}
}

/// Conversion from an `Iterator`
Expand Down

0 comments on commit 00cddb0

Please sign in to comment.