Skip to content

Commit

Permalink
Prefer empty OsStr over unsafe cast from [u8]
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jul 12, 2020
1 parent b1d6798 commit 0281a05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> {
Some((server, share)) => {
(u8_slice_as_os_str(server), u8_slice_as_os_str(share))
}
None => (u8_slice_as_os_str(path), u8_slice_as_os_str(&[])),
None => (u8_slice_as_os_str(path), OsStr::new("")),
};
return Some(VerbatimUNC(server, share));
} else {
Expand Down

0 comments on commit 0281a05

Please sign in to comment.