Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/commands/files.rs @ 46445:ca3f73cc3cf4
rhg: Simplify CommandError based on its use
Differential Revision: https://phab.mercurial-scm.org/D9905
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 28 Jan 2021 19:13:55 +0100 |
parents | 252d1bdba33d |
children | 1dcd9c9975ed |
line wrap: on
line diff
--- a/rust/rhg/src/commands/files.rs Thu Jan 28 19:21:57 2021 +0100 +++ b/rust/rhg/src/commands/files.rs Thu Jan 28 19:13:55 2021 +0100 @@ -28,8 +28,7 @@ repo: &Repo, files: impl IntoIterator<Item = &'a HgPath>, ) -> Result<(), CommandError> { - let cwd = std::env::current_dir() - .or_else(|e| Err(CommandError::CurrentDirNotFound(e)))?; + let cwd = hg::utils::current_dir()?; let rooted_cwd = cwd .strip_prefix(repo.working_directory_path()) .expect("cwd was already checked within the repository");