Skip to content

Commit 989eba7

Browse files
Add size hint to Result's FromIterator implementation.
1 parent 982a485 commit 989eba7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/result.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,11 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
10081008
None => None,
10091009
}
10101010
}
1011+
1012+
fn size_hint(&self) -> (usize, Option<usize>) {
1013+
let (_min, max) = self.iter.size_hint();
1014+
(0, max)
1015+
}
10111016
}
10121017

10131018
let mut adapter = Adapter { iter: iter.into_iter(), err: None };

0 commit comments

Comments
 (0)