We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5dcce86 commit a1a50d9Copy full SHA for a1a50d9
1 file changed
src/types.rs
@@ -66,12 +66,15 @@ impl<'a> BytesOrWideString<'a> {
66
}
67
68
69
- if let BytesOrWideString::Bytes(b) = self {
70
- if let Ok(s) = str::from_utf8(b) {
71
- return PathBuf::from(s);
72
- }
+ // cross-platform fallback is to pray we are dealing with utf-8
+ if let BytesOrWideString::Bytes(b) = self
+ && let Ok(s) = str::from_utf8(b)
+ {
73
+ PathBuf::from(s);
74
+ } else {
75
+ // or die
76
+ unreachable!()
77
- unreachable!()
78
79
80
0 commit comments