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