Mercurial > hg
diff rust/hg-core/src/revlog/revlog.rs @ 45603:be951ca95b08
hg-core: use `.or(Err(Error))` not `.map_err(|_| Error)` (D9100#inline-15067)
Differential Revision: https://phab.mercurial-scm.org/D9108
author | Antoine cezar<acezar@chwitlabs.fr> |
---|---|
date | Mon, 28 Sep 2020 16:52:35 +0200 |
parents | 1cef583541c0 |
children | 7252f5237352 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/revlog.rs Mon Sep 28 15:21:56 2020 +0200 +++ b/rust/hg-core/src/revlog/revlog.rs Mon Sep 28 16:52:35 2020 +0200 @@ -111,9 +111,8 @@ let mut delta_chain = vec![]; while let Some(base_rev) = entry.base_rev { delta_chain.push(entry); - entry = self - .get_entry(base_rev) - .map_err(|_| RevlogError::Corrupted)?; + entry = + self.get_entry(base_rev).or(Err(RevlogError::Corrupted))?; } // TODO do not look twice in the index