summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-03-04 14:43:13 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-03-04 14:43:13 +0100
commitcfd153cc64c3212e3a19e78837f3a45884975641 (patch)
tree2e70d0804b597ec4581ede9a16c28b6506993a28 /src/lib.rs
parentd5ca4e7e90a3a5ebfeff1041c7eaeb7596d9c1a5 (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.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8665c2cd..db58f6f4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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);