diff options
| author | Steven Fackler <[email protected]> | 2017-10-03 20:31:22 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-10-03 20:31:22 -0700 |
| commit | fc9f10d4e596953141165a2b1a3513fbaa579658 (patch) | |
| tree | 11a6f6d11bc412fc89a4bfb3517ced56bf047012 /openssl/src/bn.rs | |
| parent | Merge pull request #743 from AndyGauge/doc-asn1 (diff) | |
| parent | Convert try! usage to ? (diff) | |
| download | rust-openssl-fc9f10d4e596953141165a2b1a3513fbaa579658.tar.xz rust-openssl-fc9f10d4e596953141165a2b1a3513fbaa579658.zip | |
Merge pull request #750 from johnthagen/remove-try
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)) } } |