Add size hint to Result's FromIterator implementation.

This commit is contained in:
Mark-Simulacrum 2016-10-24 18:24:24 -06:00
parent 982a48575b
commit 989eba79a3

View File

@ -1008,6 +1008,11 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
None => None,
}
}
fn size_hint(&self) -> (usize, Option<usize>) {
let (_min, max) = self.iter.size_hint();
(0, max)
}
}
let mut adapter = Adapter { iter: iter.into_iter(), err: None };