Merge pull request #1461 from alexcrichton/rustfmt-web-sys

Format web-sys bindings by default
This commit is contained in:
Alex Crichton 2019-04-15 12:36:28 -05:00 committed by GitHub
commit 18746ecf4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
}