Skip to content

Commit

Permalink
Escape forward slashes in paths for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli committed Mar 25, 2024
1 parent df31314 commit ddca4b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vir/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ fn main() {
// so that one could do `clippy --fix`...
"#[allow(clippy::uninlined_format_args)]".to_string(),
"#[rustfmt::skip]".to_string(),
format!("#[path = \"{}\"]", gen_dir.join("mod.rs").display()),
// Escape "\" as "\\", especially for Windows
format!(
"#[path = \"{}\"]",
gen_dir
.join("mod.rs")
.display()
.to_string()
.replace('\\', "\\\\")
),
"mod gen;".to_string(),
]
.join("\n");
Expand Down

0 comments on commit ddca4b4

Please sign in to comment.