Skip to content

Commit 38f761b

Browse files
committed
strip prefix
1 parent 7cb43b8 commit 38f761b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bootstrap/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ fn main() {
1818

1919
// workaround for Windows
2020
// TODO: use `normpath` or a different workaround on Windows?
21-
let normalized_path = pest.to_string_lossy().to_string().replace(r#"\\?\"#, "");
21+
let pest_ref = pest.to_string_lossy();
22+
let normalized_path = pest_ref
23+
.strip_prefix(r#"\\?\"#)
24+
.unwrap_or_else(|| &pest_ref);
2225
let pest = Path::new(&normalized_path);
2326

2427
// Path on which we should write generated grammar file.

0 commit comments

Comments
 (0)