diff options
| author | johnthagen <[email protected]> | 2017-10-03 17:44:02 -0400 |
|---|---|---|
| committer | johnthagen <[email protected]> | 2017-10-03 17:44:02 -0400 |
| commit | b5bb8de4f2bd18735346a6062a13d95bcf82bdee (patch) | |
| tree | 11a6f6d11bc412fc89a4bfb3517ced56bf047012 /openssl/src/bn.rs | |
| parent | Merge pull request #743 from AndyGauge/doc-asn1 (diff) | |
| download | rust-openssl-b5bb8de4f2bd18735346a6062a13d95bcf82bdee.tar.xz rust-openssl-b5bb8de4f2bd18735346a6062a13d95bcf82bdee.zip | |
Convert try! usage to ?
Diffstat (limited to 'openssl/src/bn.rs')
| -rw-r--r-- | openssl/src/bn.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openssl/src/bn.rs b/openssl/src/bn.rs index 46d7d8f3..5a65c3ee 100644 --- a/openssl/src/bn.rs +++ b/openssl/src/bn.rs @@ -589,7 +589,7 @@ impl BigNumRef { /// ``` pub fn to_dec_str(&self) -> Result<OpensslString, ErrorStack> { unsafe { - let buf = try!(cvt_p(ffi::BN_bn2dec(self.as_ptr()))); + let buf = cvt_p(ffi::BN_bn2dec(self.as_ptr()))?; Ok(OpensslString::from_ptr(buf)) } } @@ -604,7 +604,7 @@ impl BigNumRef { /// ``` pub fn to_hex_str(&self) -> Result<OpensslString, ErrorStack> { unsafe { - let buf = try!(cvt_p(ffi::BN_bn2hex(self.as_ptr()))); + let buf = cvt_p(ffi::BN_bn2hex(self.as_ptr()))?; Ok(OpensslString::from_ptr(buf)) } } @@ -631,7 +631,7 @@ impl BigNum { pub fn new() -> Result<BigNum, ErrorStack> { unsafe { ffi::init(); - let v = try!(cvt_p(ffi::BN_new())); + let v = cvt_p(ffi::BN_new())?; Ok(BigNum::from_ptr(v)) } } @@ -649,7 +649,7 @@ impl BigNum { ffi::init(); let c_str = CString::new(s.as_bytes()).unwrap(); let mut bn = ptr::null_mut(); - try!(cvt(ffi::BN_dec2bn(&mut bn, c_str.as_ptr() as *const _))); + cvt(ffi::BN_dec2bn(&mut bn, c_str.as_ptr() as *const _))?; Ok(BigNum::from_ptr(bn)) } } @@ -660,7 +660,7 @@ impl BigNum { ffi::init(); let c_str = CString::new(s.as_bytes()).unwrap(); let mut bn = ptr::null_mut(); - try!(cvt(ffi::BN_hex2bn(&mut bn, c_str.as_ptr() as *const _))); + cvt(ffi::BN_hex2bn(&mut bn, c_str.as_ptr() as *const _))?; Ok(BigNum::from_ptr(bn)) } } |