Tracking Issue for Iterator::try_reduce (feature iterator_try_reduce) · Issue #87053 · rust-lang/rust (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Feature gate: #![feature(iterator_try_reduce)]
This is a tracking issue for adding a try_reduce
method to the Iterator
trait. There is fold
and try_fold
but only reduce
. It's possible for users to use try_fold
directly but it's also possible to use fold
directly instead of reduce
. I reason that if reduce
exists that a fallible try_reduce
should also exist to encourage the safe handling of errors.
I use the Try
trait as suggested by @sinkuu here for a similar feature.
Steps / History
- Implementation: Add a try_reduce method to the Iterator trait #87054
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.