From 989eba79a33187de03d8cdadb4994bb6b52200b0 Mon Sep 17 00:00:00 2001 From: Mark-Simulacrum Date: Mon, 24 Oct 2016 18:24:24 -0600 Subject: [PATCH] Add size hint to Result's FromIterator implementation. --- src/libcore/result.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 96845259299be..78230b608044b 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -1008,6 +1008,11 @@ impl> FromIterator> for Result { None => None, } } + + fn size_hint(&self) -> (usize, Option) { + let (_min, max) = self.iter.size_hint(); + (0, max) + } } let mut adapter = Adapter { iter: iter.into_iter(), err: None };