aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/stack.rs
diff options
context:
space:
mode:
authorjohnthagen <[email protected]>2017-10-03 17:44:02 -0400
committerjohnthagen <[email protected]>2017-10-03 17:44:02 -0400
commitb5bb8de4f2bd18735346a6062a13d95bcf82bdee (patch)
tree11a6f6d11bc412fc89a4bfb3517ced56bf047012 /openssl/src/stack.rs
parentMerge pull request #743 from AndyGauge/doc-asn1 (diff)
downloadrust-openssl-b5bb8de4f2bd18735346a6062a13d95bcf82bdee.tar.xz
rust-openssl-b5bb8de4f2bd18735346a6062a13d95bcf82bdee.zip
Convert try! usage to ?
Diffstat (limited to 'openssl/src/stack.rs')
-rw-r--r--openssl/src/stack.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/openssl/src/stack.rs b/openssl/src/stack.rs
index d20d95f7..d8589352 100644
--- a/openssl/src/stack.rs
+++ b/openssl/src/stack.rs
@@ -37,7 +37,7 @@ impl<T: Stackable> Stack<T> {
pub fn new() -> Result<Stack<T>, ErrorStack> {
unsafe {
ffi::init();
- let ptr = try!(cvt_p(OPENSSL_sk_new_null()));
+ let ptr = cvt_p(OPENSSL_sk_new_null())?;
Ok(Stack(ptr as *mut _))
}
}
@@ -218,9 +218,9 @@ impl<T: Stackable> StackRef<T> {
/// Pushes a value onto the top of the stack.
pub fn push(&mut self, data: T) -> Result<(), ErrorStack> {
unsafe {
- try!(cvt(
+ cvt(
OPENSSL_sk_push(self.as_stack(), data.as_ptr() as *mut _),
- ));
+ )?;
mem::forget(data);
Ok(())
}