File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ use std::path::{Component::*, Path};
55pub fn path_name ( path : & Path ) -> OsStringDisplay {
66 match path. components ( ) . last ( ) {
77 None | Some ( CurDir ) => OsStringDisplay :: os_string_from ( "." ) ,
8- Some ( RootDir ) => OsStringDisplay :: os_string_from ( "/" ) ,
98 Some ( Normal ( name) ) => OsStringDisplay :: os_string_from ( name) ,
109 Some ( Prefix ( prefix) ) => OsStringDisplay :: os_string_from ( prefix. as_os_str ( ) ) ,
11- Some ( ParentDir ) => OsStringDisplay :: os_string_from ( path) ,
10+ Some ( RootDir ) | Some ( ParentDir ) => OsStringDisplay :: os_string_from ( path) ,
1211 }
1312}
1413
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn root_dir() {
2929#[ test]
3030fn root_dir ( ) {
3131 let actual = path_name ( & PathBuf :: from ( "C:\\ " ) ) ;
32- let expected = OsStringDisplay :: os_string_from ( "c: " ) ;
32+ let expected = OsStringDisplay :: os_string_from ( "C: \\ " ) ;
3333 assert_eq ! ( actual, expected) ;
3434}
3535
You can’t perform that action at this time.
0 commit comments