diff --git a/src/uu/realpath/src/realpath.rs b/src/uu/realpath/src/realpath.rs index ade9d215eea..1bdd57f21c7 100644 --- a/src/uu/realpath/src/realpath.rs +++ b/src/uu/realpath/src/realpath.rs @@ -274,12 +274,12 @@ fn process_relative( ) -> PathBuf { if let Some(base) = relative_base { if path.starts_with(base) { - make_path_relative_to(path.as_path(), relative_to.unwrap_or(base)) + make_path_relative_to(path, relative_to.unwrap_or(base)) } else { path } } else if let Some(to) = relative_to { - make_path_relative_to(path.as_path(), to) + make_path_relative_to(path, to) } else { path } diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 7b47d215828..3b3fed8905d 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -489,7 +489,7 @@ pub fn paths_refer_to_same_file>(p1: P, p2: P, dereference: bool) } /// Converts absolute `path` to be relative to absolute `to` path. -pub fn make_path_relative_to>(path: P, to: P) -> PathBuf { +pub fn make_path_relative_to, P2: AsRef>(path: P1, to: P2) -> PathBuf { let path = path.as_ref(); let to = to.as_ref(); let common_prefix_size = path