Mercurial > hg
comparison rust/rhg/src/commands/cat.rs @ 45604: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 | 33ded2d3f4fc |
children | 2ad2745e0be9 |
comparison
equal
deleted
inserted
replaced
45603:be951ca95b08 | 45604:db11f8f39caf |
---|---|
38 let mut files = vec![]; | 38 let mut files = vec![]; |
39 for file in self.files.iter() { | 39 for file in self.files.iter() { |
40 let normalized = cwd.join(&file); | 40 let normalized = cwd.join(&file); |
41 let stripped = normalized | 41 let stripped = normalized |
42 .strip_prefix(&root) | 42 .strip_prefix(&root) |
43 .map_err(|_| CommandErrorKind::Abort(None))?; | 43 .or(Err(CommandErrorKind::Abort(None)))?; |
44 let hg_file = HgPathBuf::try_from(stripped.to_path_buf()) | 44 let hg_file = HgPathBuf::try_from(stripped.to_path_buf()) |
45 .map_err(|_| CommandErrorKind::Abort(None))?; | 45 .or(Err(CommandErrorKind::Abort(None)))?; |
46 files.push(hg_file); | 46 files.push(hg_file); |
47 } | 47 } |
48 | 48 |
49 match self.rev { | 49 match self.rev { |
50 Some(rev) => { | 50 Some(rev) => { |