diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index e2edb98f2..5b8cb4206 100644 --- a/src/realpath/realpath.rs +++ b/src/realpath/realpath.rs @@ -77,7 +77,7 @@ fn resolve_path(path: &str, strip: bool, zero: bool, quiet: bool) -> bool { let mut links_left = 256; for part in abs.components() { - result.push(part.as_ref()); + result.push(&part); loop { if links_left == 0 { if !quiet { show_error!("Too many symbolic links: {}", path) }; diff --git a/src/relpath/relpath.rs b/src/relpath/relpath.rs index 901a8f466..b229613b7 100644 --- a/src/relpath/relpath.rs +++ b/src/relpath/relpath.rs @@ -75,7 +75,7 @@ pub fn uumain(args: Vec) -> i32 { let mut result = PathBuf::new(); absfrom.components().skip(suffix_pos).map(|_| result.push("..")).last(); - absto.components().skip(suffix_pos).map(|x| result.push(x.as_ref())).last(); + absto.components().skip(suffix_pos).map(|x| result.push(&x)).last(); println!("{}", result.display()); 0 diff --git a/tests/common/util.rs b/tests/common/util.rs index 743fd5f16..a727f739d 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -211,7 +211,7 @@ impl AtPath { let mut unprefixed = PathBuf::new(); for component in prefixed.components() .skip(self.subdir.components().count()) { - unprefixed.push(component.as_ref().to_str().unwrap()); + unprefixed.push(component.as_os_str().to_str().unwrap()); } unprefixed } else {