Skip to content

Commit 7186651

Browse files
committed
issue-1723
1 parent 06ed77e commit 7186651

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,25 +1366,26 @@ impl Builder {
13661366
);
13671367
self
13681368
}
1369+
13691370
/// Generate the Rust bindings using the options built up thus far.
13701371
pub fn generate(mut self) -> Result<Bindings, ()> {
1371-
Bindings::generate(&Builder::generate_options(&mut self).options)
1372+
Bindings::generate(Builder::generate_options(self).options)
13721373
}
13731374

13741375
/// Preprocess and dump the input header files to disk.
13751376
///
13761377
/// This is useful when debugging bindgen, using C-Reduce, or when filing
13771378
/// issues. The resulting file will be named something like `__bindgen.i` or
13781379
/// `__bindgen.ii`
1379-
pub fn dump_preprocessed_input(&mut self) -> io::Result<()> {
1380+
pub fn dump_preprocessed_input(&self) -> io::Result<()> {
13801381
let clang =
13811382
clang_sys::support::Clang::find(None, &[]).ok_or_else(|| {
13821383
io::Error::new(
13831384
io::ErrorKind::Other,
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)