Skip to content

Commit 67462f0

Browse files
committed
Fix Windows
1 parent 7809149 commit 67462f0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ use std::path::{Component::*, Path};
55
pub 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

src/utils/test_path_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn root_dir() {
2929
#[test]
3030
fn 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

0 commit comments

Comments
 (0)