changeset 45607:db11f8f39caf

rhg: use `.or(Err(Error))` not `.map_err(|_| Error)` (D9100#inline-15067) Differential Revision: https://phab.mercurial-scm.org/D9109
author Antoine cezar<acezar@chwitlabs.fr>
date Mon, 28 Sep 2020 16:54:35 +0200
parents be951ca95b08
children 00402df57db7
files rust/rhg/src/commands/cat.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/rhg/src/commands/cat.rs	Mon Sep 28 16:52:35 2020 +0200
+++ b/rust/rhg/src/commands/cat.rs	Mon Sep 28 16:54:35 2020 +0200
@@ -40,9 +40,9 @@
             let normalized = cwd.join(&file);
             let stripped = normalized
                 .strip_prefix(&root)
-                .map_err(|_| CommandErrorKind::Abort(None))?;
+                .or(Err(CommandErrorKind::Abort(None)))?;
             let hg_file = HgPathBuf::try_from(stripped.to_path_buf())
-                .map_err(|_| CommandErrorKind::Abort(None))?;
+                .or(Err(CommandErrorKind::Abort(None)))?;
             files.push(hg_file);
         }