diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-04 14:43:13 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-03-04 14:43:13 +0100 |
commit | cfd153cc64c3212e3a19e78837f3a45884975641 (patch) | |
tree | 2e70d0804b597ec4581ede9a16c28b6506993a28 /src/lib.rs | |
parent | d5ca4e7e90a3a5ebfeff1041c7eaeb7596d9c1a5 (diff) |
Untry.
Use the ? operator instead of try, and add some more uses of it on Option<> that
were straight-forward.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -147,13 +147,13 @@ impl Default for CodegenConfig { /// use bindgen::builder; /// /// // Configure and generate bindings. -/// let bindings = try!(builder().header("path/to/input/header") -/// .whitelisted_type("SomeCoolClass") -/// .whitelisted_function("do_some_cool_thing") -/// .generate()); +/// let bindings = builder().header("path/to/input/header") +/// .whitelisted_type("SomeCoolClass") +/// .whitelisted_function("do_some_cool_thing") +/// .generate()?; /// /// // Write the generated bindings to an output file. -/// try!(bindings.write_to_file("path/to/output.rs")); +/// bindings.write_to_file("path/to/output.rs")?; /// ``` #[derive(Debug, Default)] pub struct Builder { @@ -1648,7 +1648,7 @@ impl Bindings { { let _t = time::Timer::new("parse") .with_output(time_phases); - try!(parse(&mut context)); + parse(&mut context)?; } let (items, options) = codegen::codegen(context); |