--- a/rust/rhg/src/commands/files.rs Wed Dec 16 21:06:29 2020 -0800
+++ b/rust/rhg/src/commands/files.rs Mon Dec 14 13:47:44 2020 +0100
@@ -14,7 +14,7 @@
use hg::requirements;
use hg::utils::files::{get_bytes_from_path, relativize_path};
use hg::utils::hg_path::{HgPath, HgPathBuf};
-use std::path::PathBuf;
+use std::path::Path;
pub const HELP_TEXT: &str = "
List tracked files.
@@ -34,13 +34,13 @@
fn display_files(
&self,
ui: &Ui,
- root: &PathBuf,
+ root: &Path,
files: impl IntoIterator<Item = &'a HgPath>,
) -> Result<(), CommandError> {
let cwd = std::env::current_dir()
.or_else(|e| Err(CommandErrorKind::CurrentDirNotFound(e)))?;
let rooted_cwd = cwd
- .strip_prefix(&root)
+ .strip_prefix(root)
.expect("cwd was already checked within the repository");
let rooted_cwd = HgPathBuf::from(get_bytes_from_path(rooted_cwd));