Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/errors.rs @ 46483:2845892dd489
rust: Parse system and user configuration
CLI `--config` argument parsing is still missing, as is per-repo config
Differential Revision: https://phab.mercurial-scm.org/D9961
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 04 Feb 2021 13:16:21 +0100 |
parents | d03b0601e0eb |
children | f031fe1c6ede |
line wrap: on
line diff
--- a/rust/hg-core/src/errors.rs Mon Feb 01 13:32:00 2021 +0100 +++ b/rust/hg-core/src/errors.rs Thu Feb 04 13:16:21 2021 +0100 @@ -26,11 +26,13 @@ /// Details about where an I/O error happened #[derive(Debug, derive_more::From)] pub enum IoErrorContext { - /// A filesystem operation returned `std::io::Error` + /// A filesystem operation for the given file #[from] File(std::path::PathBuf), - /// `std::env::current_dir` returned `std::io::Error` + /// `std::env::current_dir` CurrentDir, + /// `std::env::current_exe` + CurrentExe, } impl HgError { @@ -69,6 +71,7 @@ match self { IoErrorContext::File(path) => path.display().fmt(f), IoErrorContext::CurrentDir => f.write_str("current directory"), + IoErrorContext::CurrentExe => f.write_str("current executable"), } } }