diff options
| author | Mark-Simulacrum <mark.simulacrum@gmail.com> | 2016-10-24 18:24:24 -0600 |
|---|---|---|
| committer | Mark-Simulacrum <mark.simulacrum@gmail.com> | 2016-10-25 20:06:17 -0600 |
| commit | 989eba79a33187de03d8cdadb4994bb6b52200b0 (patch) | |
| tree | 572f6eabf0a94356631a0eaea8bb34b1dd861f74 /src/libcore | |
| parent | 982a48575b53e05cd53f679aac2fedf6346f78c7 (diff) | |
| download | rust-989eba79a33187de03d8cdadb4994bb6b52200b0.tar.gz rust-989eba79a33187de03d8cdadb4994bb6b52200b0.zip | |
Add size hint to Result's FromIterator implementation.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/result.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 96845259299..78230b60804 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -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 }; |
