We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d3bebb commit 5b6e3d3Copy full SHA for 5b6e3d3
src/rust/engine/options/src/lib.rs
@@ -266,9 +266,9 @@ impl OptionParser {
266
fn path_strip(prefix: &str, path: &str) -> String {
267
// TODO: The calling code should traffic in Path, or OsString, not String.
268
// For now we assume the paths are valid UTF8 strings, via unwrap().
269
- Path::new(path)
270
- .strip_prefix(prefix)
271
- .unwrap()
+ let path = Path::new(path);
+ path.strip_prefix(prefix)
+ .unwrap_or(path)
272
.to_str()
273
.unwrap()
274
.to_string()
0 commit comments