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
Feature gate:
#![feature(iterator_try_reduce)]This is a tracking issue for adding a
try_reducemethod to theIteratortrait. There isfoldandtry_foldbut onlyreduce. It's possible for users to usetry_folddirectly but it's also possible to usefolddirectly instead ofreduce. I reason that ifreduceexists that a fallibletry_reduceshould also exist to encourage the safe handling of errors.I use the
Trytrait as suggested by @sinkuu here for a similar feature.Steps / History
try_reducemethod to the Iterator trait #87054Unresolved Questions