Skip to content

Commit

Permalink
Merge pull request #1461 from alexcrichton/rustfmt-web-sys
Browse files Browse the repository at this point in the history
Format web-sys bindings by default
  • Loading branch information
alexcrichton committed Apr 15, 2019
2 parents 3ab9bb1 + fd4f0b6 commit 18746ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/web-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ fn try_main() -> Result<(), failure::Error> {

// run rustfmt on the generated file - really handy for debugging
println!("cargo:rerun-if-env-changed=WEBIDL_RUSTFMT_BINDINGS");
if env::var("WEBIDL_RUSTFMT_BINDINGS").is_ok() {
if env::var("WEBIDL_RUSTFMT_BINDINGS").ok() != Some("0".to_string()) {
let status = Command::new("rustfmt")
.arg(&out_file_path)
.status()
.context("running rustfmt")?;
if !status.success() {
bail!("rustfmt failed: {}", status)
println!("cargo:warning=rustfmt failed: {}", status)
}
}

Expand Down

0 comments on commit 18746ec

Please sign in to comment.