Tracking Issue for Iterator::try_reduce (feature iterator_try_reduce) · Issue #87053 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@kit-981

Description

@kit-981

Feature gate: #![feature(iterator_try_reduce)]

This is a tracking issue for adding a try_reduce method to the Iteratortrait. There is foldand 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

Unresolved Questions