Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/lib.rs @ 47343:ed1583a845d2
dirstate-v2: Make more APIs fallible, returning Result
When parsing becomes lazy, parse error will potentially happen in more places.
This propagates such errors to callers.
Differential Revision: https://phab.mercurial-scm.org/D10749
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 19 May 2021 13:15:00 +0200 |
parents | 5d62243c7732 |
children | 6e49769b7f97 |
line wrap: on
line diff
--- a/rust/hg-core/src/lib.rs Wed May 19 13:15:00 2021 +0200 +++ b/rust/hg-core/src/lib.rs Wed May 19 13:15:00 2021 +0200 @@ -83,6 +83,15 @@ Common(errors::HgError), } +impl fmt::Display for DirstateError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + DirstateError::Map(error) => error.fmt(f), + DirstateError::Common(error) => error.fmt(f), + } + } +} + #[derive(Debug, derive_more::From)] pub enum PatternError { #[from]