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/stack.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/stack.rs')
| -rw-r--r-- | openssl/src/stack.rs | 6 |
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(()) } |