@@ -1336,7 +1336,7 @@ impl Builder {
1336
1336
}
1337
1337
1338
1338
/// Generate the Rust bindings options
1339
- pub fn generate_options ( mut self ) -> Self {
1339
+ pub fn generate_options ( & mut self ) -> & mut Self {
1340
1340
// Add any extra arguments from the environment to the clang command line.
1341
1341
if let Some ( extra_clang_args) =
1342
1342
env:: var ( "BINDGEN_EXTRA_CLANG_ARGS" ) . ok ( )
@@ -1366,27 +1366,25 @@ impl Builder {
1366
1366
) ;
1367
1367
self
1368
1368
}
1369
-
1370
1369
/// Generate the Rust bindings using the options built up thus far.
1371
- pub fn generate ( self ) -> Result < Bindings , ( ) > {
1372
- Bindings :: generate ( Builder :: generate_options ( self ) . options )
1370
+ pub fn generate ( mut self ) -> Result < Bindings , ( ) > {
1371
+ Bindings :: generate ( & Builder :: generate_options ( & mut self ) . options )
1373
1372
}
1374
1373
1375
1374
/// Preprocess and dump the input header files to disk.
1376
1375
///
1377
1376
/// This is useful when debugging bindgen, using C-Reduce, or when filing
1378
1377
/// issues. The resulting file will be named something like `__bindgen.i` or
1379
1378
/// `__bindgen.ii`
1380
- pub fn dump_preprocessed_input ( & self ) -> io:: Result < ( ) > {
1379
+ pub fn dump_preprocessed_input ( & mut self ) -> io:: Result < ( ) > {
1381
1380
let clang =
1382
1381
clang_sys:: support:: Clang :: find ( None , & [ ] ) . ok_or_else ( || {
1383
1382
io:: Error :: new (
1384
1383
io:: ErrorKind :: Other ,
1385
1384
"Cannot find clang executable" ,
1386
1385
)
1387
1386
} ) ?;
1388
- //Builder::generate_options(self);
1389
-
1387
+ Builder :: generate_options ( self ) ;
1390
1388
// The contents of a wrapper file that includes all the input header
1391
1389
// files.
1392
1390
let mut wrapper_contents = String :: new ( ) ;
@@ -2099,7 +2097,7 @@ impl Bindings {
2099
2097
2100
2098
/// Generate bindings for the given options.
2101
2099
pub ( crate ) fn generate (
2102
- mut options : BindgenOptions ,
2100
+ mut options : & BindgenOptions ,
2103
2101
) -> Result < Bindings , ( ) > {
2104
2102
ensure_libclang_is_loaded ( ) ;
2105
2103
0 commit comments