From 00cddb068c4cb17a91cca646103e0fba8c0a8077 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 20 Jan 2015 18:15:28 -0500 Subject: [PATCH] also forward Iterator::size_hint() --- src/liballoc/boxed.rs | 4 ++++ src/libcore/iter.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 89de2c953e4..7965c00a365 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -194,6 +194,10 @@ impl<'a, T> Iterator for Box + 'a> { fn next(&mut self) -> Option { (**self).next() } + + fn size_hint(&self) -> (usize, Option) { + (**self).size_hint() + } } #[cfg(test)] diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 3d51f75d9b3..2a21ceef7a1 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -107,6 +107,10 @@ impl<'a, T> Iterator for &'a mut (Iterator + 'a) { fn next(&mut self) -> Option { (**self).next() } + + fn size_hint(&self) -> (usize, Option) { + (**self).size_hint() + } } /// Conversion from an `Iterator` -- 2.44.0