Skip to content

Commit 0281a05

Browse files
committed
Prefer empty OsStr over unsafe cast from [u8]
1 parent b1d6798 commit 0281a05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sys/windows/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> {
5050
Some((server, share)) => {
5151
(u8_slice_as_os_str(server), u8_slice_as_os_str(share))
5252
}
53-
None => (u8_slice_as_os_str(path), u8_slice_as_os_str(&[])),
53+
None => (u8_slice_as_os_str(path), OsStr::new("")),
5454
};
5555
return Some(VerbatimUNC(server, share));
5656
} else {

0 commit comments

Comments
 (0)