Skip to content

Commit

Permalink
Add size hint to Result's FromIterator implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Oct 26, 2016
1 parent 982a485 commit 989eba7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit 989eba7

Please sign in to comment.