Skip to content

Commit

Permalink
Produce a more useful error message when rustfmt can't be found. Fixes
Browse files Browse the repository at this point in the history
…#1205

Prior to this change bindgen would simply print any error that occurred
while attempting to run rustfmt straight to stderr using fmt::Debug.
Combined with the fact that rustfmt is enabled by default now this meant that
if rustfmt was missing or not working a cryptic error would be printed.
  • Loading branch information
luser committed Jan 25, 2019
1 parent 22194a0 commit 4697025
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ impl Bindings {
writer.write(rustfmt_bindings.as_bytes())?;
},
Err(err) => {
eprintln!("{:?}", err);
eprintln!("Failed to run rustfmt: {} (non-fatal, continuing)", err);
writer.write(bindings.as_bytes())?;
},
}
Expand Down

0 comments on commit 4697025

Please sign in to comment.