File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/uucore/src/lib/features Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -539,9 +539,11 @@ pub fn display_permissions_unix(mode: mode_t, display_file_type: bool) -> String
539
539
/// install -d foo/. (and foo/./) should work and just create foo/
540
540
/// std::fs::create_dir("foo/."); fails in pure Rust
541
541
pub fn dir_strip_dot_for_creation ( path : & Path ) -> PathBuf {
542
- if path. to_string_lossy ( ) . ends_with ( "/." ) || path. to_string_lossy ( ) . ends_with ( "/./" ) {
542
+ let path_str = path. to_string_lossy ( ) ;
543
+
544
+ if path_str. ends_with ( "/." ) || path_str. ends_with ( "/./" ) {
543
545
// Do a simple dance to strip the "/."
544
- Path :: new ( & path) . components ( ) . collect :: < PathBuf > ( )
546
+ Path :: new ( & path) . components ( ) . collect ( )
545
547
} else {
546
548
path. to_path_buf ( )
547
549
}
You can’t perform that action at this time.
0 commit comments