From 59f2d12a8f8c77b624684addfdf7e4c9401604bf Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:14:56 +0900 Subject: [PATCH] install: remove a to_string_lossy --- src/uu/install/src/install.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 3105170588..daaee1201d 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -577,17 +577,9 @@ fn is_new_file_path(path: &Path) -> bool { /// Test if the path is an existing directory or ends with a trailing separator. /// /// Returns true, if one of the conditions above is met; else false. -/// -#[cfg(unix)] fn is_potential_directory_path(path: &Path) -> bool { let separator = MAIN_SEPARATOR as u8; - path.as_os_str().as_bytes().last() == Some(&separator) || path.is_dir() -} - -#[cfg(not(unix))] -fn is_potential_directory_path(path: &Path) -> bool { - let path_str = path.to_string_lossy(); - path_str.ends_with(MAIN_SEPARATOR) || path_str.ends_with('/') || path.is_dir() + path.as_os_str().as_encoded_bytes().last() == Some(&separator) || path.is_dir() } /// Perform an install, given a list of paths and behavior.