Pre-RFC: Add err_iter and err_iter_mut to Result<T, E>

Would there be any appetite for adding these methods? Would an RFC even be needed?

Basically they would be the Result::Err equivalent to the iter and iter_mut methods already present.

Why?

2 Likes

You can already write result.as_ref().err().into_iter(), or the same with as_mut().

For completeness is really the only reason since it is hard to argue that the using the direct version is "harder" .

Yes and the iter is basically doing just that.