Skip to content

Commit 9f92542

Browse files
committed
issue 1723 [WIP] fixed merge conflicts
2 parents 8577bca + f1c8bcc commit 9f92542

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/lib.rs

Lines changed: 6 additions & 8 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) -> Self {
1339+
pub fn generate_options(&mut self) -> &mut 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,27 +1366,25 @@ impl Builder {
13661366
);
13671367
self
13681368
}
1369-
13701369
/// 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)
13731372
}
13741373

13751374
/// Preprocess and dump the input header files to disk.
13761375
///
13771376
/// This is useful when debugging bindgen, using C-Reduce, or when filing
13781377
/// issues. The resulting file will be named something like `__bindgen.i` or
13791378
/// `__bindgen.ii`
1380-
pub fn dump_preprocessed_input(&self) -> io::Result<()> {
1379+
pub fn dump_preprocessed_input(&mut self) -> io::Result<()> {
13811380
let clang =
13821381
clang_sys::support::Clang::find(None, &[]).ok_or_else(|| {
13831382
io::Error::new(
13841383
io::ErrorKind::Other,
13851384
"Cannot find clang executable",
13861385
)
13871386
})?;
1388-
//Builder::generate_options(self);
1389-
1387+
Builder::generate_options(self);
13901388
// The contents of a wrapper file that includes all the input header
13911389
// files.
13921390
let mut wrapper_contents = String::new();
@@ -2099,7 +2097,7 @@ impl Bindings {
20992097

21002098
/// Generate bindings for the given options.
21012099
pub(crate) fn generate(
2102-
mut options: BindgenOptions,
2100+
mut options: &BindgenOptions,
21032101
) -> Result<Bindings, ()> {
21042102
ensure_libclang_is_loaded();
21052103

0 commit comments

Comments
 (0)