This is an archive of the discontinued Mercurial Phabricator instance.

hg-core: return `Err` on decompression error (D8958#inline-15004 followup)
ClosedPublic

Authored by acezar on Sep 28 2020, 9:48 AM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

acezar created this revision.Sep 28 2020, 9:48 AM
Alphare requested changes to this revision.Sep 28 2020, 10:18 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/revlog/revlog.rs
263

.map(RevlogError::Corrupted) is simpler and just as effective.

This revision now requires changes to proceed.Sep 28 2020, 10:18 AM
Alphare added inline comments.Sep 28 2020, 10:32 AM
rust/hg-core/src/revlog/revlog.rs
263

Sorry .or(Err(RevlogError::Corrupted)). I could expect the optimizer to take care of the closure, but this is more explicit.

acezar updated this revision to Diff 22895.Sep 28 2020, 10:33 AM
acezar marked 2 inline comments as done.Sep 28 2020, 10:34 AM