forked from rust-random/rand
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix FlatMap::size_hint (thanks @bluss)
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e3784ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was pinged. The sub iters may be empty, so the lower bound is still zero for the second case unfortunately.
e3784ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
frontiter
is the only available sub-iter; if it gives us a lower-bound, we know at least this many items are available (next
doesn't even evaluateself.len
untilself.frontiter
is exhausted).