Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/main.rs @ 46596:d2e61f00ee9d
rust: Introduce a get_bytes_from_os_str utility function
It does the same as get_bytes_from_path but takes an `OsStr`
instead of a `Path`. The implementation is the same so using either
ends up correct but the function name suggests it?s not.
Differential Revision: https://phab.mercurial-scm.org/D10007
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 17 Feb 2021 11:21:34 +0100 |
parents | 5ce2aa7c2ad5 |
children | 755c31a1caf9 |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Wed Feb 17 12:24:53 2021 +0100 +++ b/rust/rhg/src/main.rs Wed Feb 17 11:21:34 2021 +0100 @@ -70,8 +70,7 @@ }; let config_args = values_of_global_arg("config") - // `get_bytes_from_path` works for OsStr the same as for Path - .map(hg::utils::files::get_bytes_from_path); + .map(hg::utils::files::get_bytes_from_os_str); let non_repo_config = &hg::config::Config::load(config_args)?; let repo_path = value_of_global_arg("repository").map(Path::new);