From 91b7ae44d6b90fefda36be346e3af11680f44d76 Mon Sep 17 00:00:00 2001 From: Alex Lyon Date: Wed, 17 Jan 2018 15:35:42 -0800 Subject: [PATCH] realpath, relpath: fix on stable and beta (whoops) --- src/realpath/realpath.rs | 2 +- src/relpath/relpath.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index 5b8cb4206..e801efb4c 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); + result.push(part.as_os_str()); 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 b229613b7..b1bd0ac41 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)).last(); + absto.components().skip(suffix_pos).map(|x| result.push(x.as_os_str())).last(); println!("{}", result.display()); 0