Closed Kmeakin closed 1 year ago
Encountered this while writing my own unifier (https://github.com/Kmeakin/pion/blob/master/crates/pion-core/src/elab/unify.rs#L415). try_fold is short circuiting (will return early on the first Err), while fold is not.
try_fold
Err
fold
Submitted an issue to detect this pattern with clippy: https://github.com/rust-lang/rust-clippy/issues/10208
Ooh, very handy!
Encountered this while writing my own unifier (https://github.com/Kmeakin/pion/blob/master/crates/pion-core/src/elab/unify.rs#L415).
try_fold
is short circuiting (will return early on the firstErr
), whilefold
is not.