@@ -456,13 +456,16 @@ impl Builder {
456
456
) ;
457
457
}
458
458
459
- if !self . options . format_bindings {
460
- output_vector. push ( "--format -bindings" . into ( ) ) ;
459
+ if !self . options . rustfmt_bindings {
460
+ output_vector. push ( "--rustfmt -bindings" . into ( ) ) ;
461
461
}
462
462
463
- if let Some ( path) = self . options . format_configuration_file . as_ref ( ) . and_then (
464
- |f| f. to_str ( ) ) {
465
- output_vector. push ( "--format-configuration-file" . into ( ) ) ;
463
+ if let Some ( path) = self . options
464
+ . rustfmt_configuration_file
465
+ . as_ref ( )
466
+ . and_then ( |f| f. to_str ( ) )
467
+ {
468
+ output_vector. push ( "--rustfmt-configuration-file" . into ( ) ) ;
466
469
output_vector. push ( path. into ( ) ) ;
467
470
}
468
471
@@ -852,15 +855,16 @@ impl Builder {
852
855
}
853
856
854
857
/// Set whether rustfmt should format the generated bindings.
855
- pub fn format_bindings ( mut self , doit : bool ) -> Self {
856
- self . options . format_bindings = doit;
858
+ pub fn rustfmt_bindings ( mut self , doit : bool ) -> Self {
859
+ self . options . rustfmt_bindings = doit;
857
860
self
858
861
}
859
862
860
863
/// Set the absolute path to the rustfmt configuration file, if None, the standard rustfmt
861
864
/// options are used.
862
- pub fn format_configuration_file ( mut self , path : Option < PathBuf > ) -> Self {
863
- self . options . format_configuration_file = path;
865
+ pub fn rustfmt_configuration_file ( mut self , path : Option < PathBuf > ) -> Self {
866
+ self = self . rustfmt_bindings ( true ) ;
867
+ self . options . rustfmt_configuration_file = path;
864
868
self
865
869
}
866
870
@@ -1125,11 +1129,11 @@ pub struct BindgenOptions {
1125
1129
rust_features : RustFeatures ,
1126
1130
1127
1131
/// Whether rustfmt should format the generated bindings.
1128
- pub format_bindings : bool ,
1132
+ pub rustfmt_bindings : bool ,
1129
1133
1130
1134
/// The absolute path to the rustfmt configuration file, if None, the standard rustfmt
1131
1135
/// options are used.
1132
- pub format_configuration_file : Option < PathBuf > ,
1136
+ pub rustfmt_configuration_file : Option < PathBuf > ,
1133
1137
}
1134
1138
1135
1139
/// TODO(emilio): This is sort of a lie (see the error message that results from
@@ -1214,8 +1218,8 @@ impl Default for BindgenOptions {
1214
1218
objc_extern_crate : false ,
1215
1219
enable_mangling : true ,
1216
1220
prepend_enum_name : true ,
1217
- format_bindings : true ,
1218
- format_configuration_file : None ,
1221
+ rustfmt_bindings : true ,
1222
+ rustfmt_configuration_file : None ,
1219
1223
}
1220
1224
}
1221
1225
}
0 commit comments