Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Nov 5, 2016
1 parent ac36d54 commit 52feaae
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions openssl/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ impl<T: Stackable> IntoIter<T> {
fn stack_len(&self) -> c_int {
unsafe { OPENSSL_sk_num(self.stack as *mut _) }
}

unsafe fn get(&mut self, i: c_int) -> T {
let ptr = OPENSSL_sk_value(self.stack as *mut _, i);
T::from_ptr(ptr as *mut _)
}
}

impl<T: Stackable> Drop for IntoIter<T> {
Expand All @@ -139,10 +134,9 @@ impl<T: Stackable> Iterator for IntoIter<T> {
if self.idx == self.stack_len() {
None
} else {
let idx = self.idx;
let ptr = OPENSSL_sk_value(self.stack as *mut _, self.idx);
self.idx += 1;
let v = self.get(idx);
Some(v)
Some(T::from_ptr(ptr as *mut _))
}
}
}
Expand Down

0 comments on commit 52feaae

Please sign in to comment.