Skip to content

Commit 5b6e3d3

Browse files
committed
Fix unwrap
1 parent 9d3bebb commit 5b6e3d3

File tree

1 file changed

+3
-3
lines changed
  • src/rust/engine/options/src

1 file changed

+3
-3
lines changed

src/rust/engine/options/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ impl OptionParser {
266266
fn path_strip(prefix: &str, path: &str) -> String {
267267
// TODO: The calling code should traffic in Path, or OsString, not String.
268268
// For now we assume the paths are valid UTF8 strings, via unwrap().
269-
Path::new(path)
270-
.strip_prefix(prefix)
271-
.unwrap()
269+
let path = Path::new(path);
270+
path.strip_prefix(prefix)
271+
.unwrap_or(path)
272272
.to_str()
273273
.unwrap()
274274
.to_string()

0 commit comments

Comments
 (0)