Skip to content

Commit 692ff74

Browse files
committed
Removed verbose option flag from builder, and kept it in options
1 parent 62f8ed1 commit 692ff74

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

src/lib.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -433,17 +433,6 @@ impl Builder {
433433
self
434434
}
435435

436-
/// Set to output verbose messages
437-
pub fn verbose(mut self) -> Self {
438-
self.options.verbose = true;
439-
self
440-
}
441-
442-
/// Is set to output verbose messages
443-
pub fn is_verbose(&self) -> bool {
444-
return self.options.verbose;
445-
}
446-
447436
/// Generate the Rust bindings using the options built up thus far.
448437
pub fn generate<'ctx>(self) -> Result<Bindings<'ctx>, ()> {
449438
Bindings::generate(self.options, None)
@@ -554,19 +543,16 @@ pub struct BindgenOptions {
554543
/// See the builder method description for more details.
555544
pub conservative_inline_namespaces: bool,
556545

557-
/// Whether to keep documentation comments in the generated output. See the
546+
/// Wether to keep documentation comments in the generated output. See the
558547
/// documentation for more details.
559548
pub generate_comments: bool,
560549

561-
/// Whether to whitelist types recursively. Defaults to true.
550+
/// Wether to whitelist types recursively. Defaults to true.
562551
pub whitelist_recursively: bool,
563552

564553
/// Intead of emitting 'use objc;' to files generated from objective c files,
565554
/// generate '#[macro_use] extern crate objc;'
566555
pub objc_extern_crate: bool,
567-
568-
/// Whether we should print verbose messages.
569-
pub verbose: bool,
570556
}
571557

572558
/// TODO(emilio): This is sort of a lie (see the error message that results from
@@ -619,7 +605,6 @@ impl Default for BindgenOptions {
619605
generate_comments: true,
620606
whitelist_recursively: true,
621607
objc_extern_crate: false,
622-
verbose: false,
623608
}
624609
}
625610
}

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ pub fn main() {
4444
}
4545

4646
match builder_from_flags(bind_args.into_iter()) {
47-
Ok((builder, output)) => {
47+
Ok((builder, output, verbose)) => {
4848

49-
let verbose = (&builder).is_verbose();
5049
let builder_result =
5150
panic::catch_unwind(||
5251
builder.generate().expect("Unable to generate bindings")

src/options.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::io::{self, Error, ErrorKind};
55

66
/// Construct a new [`Builder`](./struct.Builder.html) from command line flags.
77
pub fn builder_from_flags<I>(args: I)
8-
-> Result<(Builder, Box<io::Write>), io::Error>
8+
-> Result<(Builder, Box<io::Write>, bool), io::Error>
99
where I: Iterator<Item = String>,
1010
{
1111
let matches = App::new("bindgen")
@@ -349,9 +349,7 @@ pub fn builder_from_flags<I>(args: I)
349349
Box::new(io::BufWriter::new(io::stdout())) as Box<io::Write>
350350
};
351351

352-
if matches.is_present("verbose") {
353-
builder = builder.verbose();
354-
}
352+
let verbose = matches.is_present("verbose");
355353

356-
Ok((builder, output))
354+
Ok((builder, output, verbose))
357355
}

tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn create_bindgen_builder(header: &PathBuf)
118118
.chain(flags.into_iter());
119119

120120
builder_from_flags(args)
121-
.map(|(builder, _)| Some(builder.no_unstable_rust()))
121+
.map(|(builder, _, _)| Some(builder.no_unstable_rust()))
122122
}
123123

124124
macro_rules! test_header {

0 commit comments

Comments
 (0)