-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Iterator::try_for_each #48157
Add Iterator::try_for_each #48157
Conversation
The fallible version of for_each and the stateless version of try_fold.
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
r? @dtolnay |
@rfcbot fcp merge |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@dtolnay proposal cancelled. |
@bors r+ |
📌 Commit 0bb818c has been approved by |
Add Iterator::try_for_each The fallible version of `for_each` aka the stateless version of `try_fold`. Inspired by @cuviper's comment in rust-lang#45379 (comment) as a more direct and obvious solution than `.map(f).collect::<Result<(), _>>()`. Like `for_each`, no need for an `r` version thanks to overrides in `Rev`. `iterator_try_fold` tracking issue: rust-lang#45594
Add Iterator::try_for_each The fallible version of `for_each` aka the stateless version of `try_fold`. Inspired by @cuviper's comment in rust-lang#45379 (comment) as a more direct and obvious solution than `.map(f).collect::<Result<(), _>>()`. Like `for_each`, no need for an `r` version thanks to overrides in `Rev`. `iterator_try_fold` tracking issue: rust-lang#45594
The fallible version of
for_each
aka the stateless version oftry_fold
. Inspired by @cuviper's comment in #45379 (comment) as a more direct and obvious solution than.map(f).collect::<Result<(), _>>()
.Like
for_each
, no need for anr
version thanks to overrides inRev
.iterator_try_fold
tracking issue: #45594