Skip to content

Commit d6a6fdf

Browse files
committed
Don't assert rustfmt succeeds
Not all environments have it so only run it and hope it succeeds.
1 parent 7ef1e35 commit d6a6fdf

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

crates/web-sys/build.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,11 @@ fn try_main() -> Result<(), failure::Error> {
112112
println!("cargo:rustc-env=BINDINGS={}", out_file_path.display());
113113

114114
// run rustfmt on the generated file - really handy for debugging
115+
//
116+
// This is opportunistic though so don't assert that it succeeds.
115117
println!("cargo:rerun-if-env-changed=WEBIDL_RUSTFMT_BINDINGS");
116118
if env::var("WEBIDL_RUSTFMT_BINDINGS").ok() != Some("0".to_string()) {
117-
let status = Command::new("rustfmt")
118-
.arg(&out_file_path)
119-
.status()
120-
.context("running rustfmt")?;
121-
if !status.success() {
122-
println!("cargo:warning=rustfmt failed: {}", status)
123-
}
119+
drop(Command::new("rustfmt").arg(&out_file_path).status());
124120
}
125121

126122
Ok(())

0 commit comments

Comments
 (0)