Skip to content

Commit 4697025

Browse files
committed
Produce a more useful error message when rustfmt can't be found. Fixes #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.
1 parent 22194a0 commit 4697025

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ impl Bindings {
18351835
writer.write(rustfmt_bindings.as_bytes())?;
18361836
},
18371837
Err(err) => {
1838-
eprintln!("{:?}", err);
1838+
eprintln!("Failed to run rustfmt: {} (non-fatal, continuing)", err);
18391839
writer.write(bindings.as_bytes())?;
18401840
},
18411841
}

0 commit comments

Comments
 (0)