aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/stack.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-02-04 08:54:25 -0800
committerGitHub <[email protected]>2017-02-04 08:54:25 -0800
commit084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a (patch)
tree6c3e0f158d3cf63e5ae8229126e3430847398ad3 /openssl/src/stack.rs
parentMerge pull request #571 from sfackler/build-script-cleanup (diff)
parentSwitch to foreign_types (diff)
downloadrust-openssl-084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a.tar.xz
rust-openssl-084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a.zip
Merge pull request #572 from sfackler/foreign-types
Switch to foreign_types
Diffstat (limited to 'openssl/src/stack.rs')
-rw-r--r--openssl/src/stack.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/openssl/src/stack.rs b/openssl/src/stack.rs
index dae42ca8..372040aa 100644
--- a/openssl/src/stack.rs
+++ b/openssl/src/stack.rs
@@ -1,12 +1,12 @@
-use std::ops::{Deref, DerefMut, Index, IndexMut};
-use std::iter;
+use foreign_types::{ForeignTypeRef, ForeignType};
+use libc::c_int;
use std::borrow::Borrow;
use std::convert::AsRef;
+use std::iter;
use std::marker::PhantomData;
-use libc::c_int;
use std::mem;
+use std::ops::{Deref, DerefMut, Index, IndexMut};
-use types::{OpenSslType, OpenSslTypeRef};
use util::Opaque;
#[cfg(ossl10x)]
@@ -17,9 +17,8 @@ use ffi::{OPENSSL_sk_pop, OPENSSL_sk_free, OPENSSL_sk_num, OPENSSL_sk_value, OPE
/// Trait implemented by types which can be placed in a stack.
///
-/// Like `OpenSslType`, it should not be implemented for any type outside
-/// of this crate.
-pub trait Stackable: OpenSslType {
+/// It should not be implemented for any type outside of this crate.
+pub trait Stackable: ForeignType {
/// The C stack type for this element.
///
/// Generally called `stack_st_{ELEMENT_TYPE}`, normally hidden by the
@@ -72,7 +71,7 @@ impl<T: Stackable> Borrow<StackRef<T>> for Stack<T> {
}
}
-impl<T: Stackable> OpenSslType for Stack<T> {
+impl<T: Stackable> ForeignType for Stack<T> {
type CType = T::StackType;
type Ref = StackRef<T>;
@@ -140,7 +139,7 @@ impl<T: Stackable> ExactSizeIterator for IntoIter<T> {}
pub struct StackRef<T: Stackable>(Opaque, PhantomData<T>);
-impl<T: Stackable> OpenSslTypeRef for StackRef<T> {
+impl<T: Stackable> ForeignTypeRef for StackRef<T> {
type CType = T::StackType;
}