-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fold_first iterator consumer #106348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fold_first iterator consumer #106348
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
You need an ACP first. |
This comment has been minimized.
This comment has been minimized.
ced5ee3
to
bd35161
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #108421) made this pull request unmergeable. Please resolve the merge conflicts. |
how many iterator adapters/consumers are we going to add...
rust-lang/libs-team#157
This simple extension on fold is very similar to reduce, but on numerous occasions I have wanted to reduce but into a different type. This means I manually re-implement reduce with fold every time I need that.
This implements a
fold_first
(please bikeshed) which provides aninit
method.reduce
is re-implemented asfold_first(identity, f)
Similarly, I've implemented the try/rfold variants too