diff options
| author | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
|---|---|---|
| committer | Andy Gauge <[email protected]> | 2017-10-09 12:10:04 -0700 |
| commit | 2c7f0e7604e758d2ba7f6f39ab78d8302f484f65 (patch) | |
| tree | b939ebd1ac58177ad4e7a8f25b488f8fe41cd61f /openssl/src/stack.rs | |
| parent | Begun DSA documentation (diff) | |
| parent | Merge pull request #753 from zsck/issue719 (diff) | |
| download | rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.tar.xz rust-openssl-2c7f0e7604e758d2ba7f6f39ab78d8302f484f65.zip | |
Merge branch 'master' of https://github.com/sfackler/rust-openssl
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(()) } |