Skip to content

Commit 43a76d6

Browse files
committed
issue 1723 [WIP] rebased. Took a step backwards to something that compiles. Have commented away the Builder::generate_options() that causes errors. Lets go from here
1 parent 9f92542 commit 43a76d6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ impl Builder {
13361336
}
13371337

13381338
/// Generate the Rust bindings options
1339-
pub fn generate_options(&mut self) -> &mut Self {
1339+
pub fn generate_options(mut self) -> Self {
13401340
// Add any extra arguments from the environment to the clang command line.
13411341
if let Some(extra_clang_args) =
13421342
env::var("BINDGEN_EXTRA_CLANG_ARGS").ok()
@@ -1366,9 +1366,10 @@ impl Builder {
13661366
);
13671367
self
13681368
}
1369+
13691370
/// Generate the Rust bindings using the options built up thus far.
1370-
pub fn generate(mut self) -> Result<Bindings, ()> {
1371-
Bindings::generate(&Builder::generate_options(&mut self).options)
1371+
pub fn generate(self) -> Result<Bindings, ()> {
1372+
Bindings::generate(Builder::generate_options(self).options)
13721373
}
13731374

13741375
/// Preprocess and dump the input header files to disk.
@@ -1384,7 +1385,7 @@ impl Builder {
13841385
"Cannot find clang executable",
13851386
)
13861387
})?;
1387-
Builder::generate_options(self);
1388+
// Builder::generate_options(self);
13881389
// The contents of a wrapper file that includes all the input header
13891390
// files.
13901391
let mut wrapper_contents = String::new();
@@ -2097,7 +2098,7 @@ impl Bindings {
20972098

20982099
/// Generate bindings for the given options.
20992100
pub(crate) fn generate(
2100-
mut options: &BindgenOptions,
2101+
mut options: BindgenOptions,
21012102
) -> Result<Bindings, ()> {
21022103
ensure_libclang_is_loaded();
21032104

0 commit comments

Comments
 (0)