diff options
author | Harlan Haskins <harlan@harlanhaskins.com> | 2017-09-22 15:58:23 -0400 |
---|---|---|
committer | Harlan Haskins <harlan@harlanhaskins.com> | 2017-09-22 16:39:13 -0400 |
commit | 89b4dbc55abb037aba2556052e15fc91c95da9cd (patch) | |
tree | 81f91b0b8f443f14f8ee2bedd736e44209d6a656 /src/lib.rs | |
parent | becdc797a2c12b4bb272b3a3b5ad577acf750e39 (diff) |
Enable --rustfmt-bindings by default
This patch flips --rustfmt-bindings to --no-rustfmt-bindings and enables
formatting by default. If rustfmt is not accessible, a warning is
printed and the bindings are printed unformatted.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -492,7 +492,7 @@ impl Builder { } if !self.options.rustfmt_bindings { - output_vector.push("--rustfmt-bindings".into()); + output_vector.push("--no-rustfmt-bindings".into()); } if let Some(path) = self.options @@ -1412,7 +1412,7 @@ impl Default for BindgenOptions { enable_mangling: true, prepend_enum_name: true, time_phases: false, - rustfmt_bindings: false, + rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: Default::default(), } @@ -1604,10 +1604,8 @@ impl Bindings { let rustfmt = if let Ok(rustfmt) = which::which("rustfmt") { rustfmt } else { - return Err(io::Error::new( - io::ErrorKind::Other, - "Rustfmt activated, but it could not be found in global path.", - )); + warn!("Not running rustfmt because it does not exist in PATH"); + return Ok(()); }; let mut cmd = Command::new(rustfmt); |