]> git.lizzy.rs Git - rust.git/commitdiff
also forward Iterator::size_hint()
authorJorge Aparicio <japaricious@gmail.com>
Tue, 20 Jan 2015 23:15:28 +0000 (18:15 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Tue, 20 Jan 2015 23:15:28 +0000 (18:15 -0500)
src/liballoc/boxed.rs
src/libcore/iter.rs

index 89de2c953e4c2f6280a7397f3ca5418f687d4b2f..7965c00a3651059e9836c66493af5aea2af82cdb 100644 (file)
@@ -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)]
index 3d51f75d9b3097081c56cfe078f1b0dec10e4660..2a21ceef7a152d27d9758d32bf5d1cc582860192 100644 (file)
@@ -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`