( )⚙ D11410 rust: Return HgError instead of RevlogError in revlog constructors

This is an archive of the discontinued Mercurial Phabricator instance.

rust: Return HgError instead of RevlogError in revlog constructors
ClosedPublic

Authored by SimonSapin on Sep 13 2021, 2:14 PM.

Details

Summary

This leaves fewer cases for callers to handle, as RevlogError is more general

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

SimonSapin created this revision.Sep 13 2021, 2:14 PM

as RevlogError is more general

Don't you mean the opposite?

There are strictly more error cases that can be represented by RevlogError so it is more general. (Since it has an Other variant that contains an HgError, plus some other variants.)

Alphare accepted this revision.Sep 14 2021, 3:48 AM
This revision is now accepted and ready to land.Sep 14 2021, 3:48 AM