From b5bb8de4f2bd18735346a6062a13d95bcf82bdee Mon Sep 17 00:00:00 2001 From: johnthagen Date: Tue, 3 Oct 2017 17:44:02 -0400 Subject: Convert try! usage to ? --- openssl/src/stack.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openssl/src/stack.rs') 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 Stack { pub fn new() -> Result, 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 StackRef { /// 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(()) } -- cgit v1.2.3