diff options
| author | Steven Fackler <[email protected]> | 2017-11-21 08:51:37 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-21 08:51:37 -0800 |
| commit | de987f20c8ac82d419a0647ca2970331f1ff640e (patch) | |
| tree | bd7981060fbcb8fdcc91b273361b87907d7e3bbf /openssl | |
| parent | Merge pull request #778 from nox/foreign-types (diff) | |
| download | rust-openssl-de987f20c8ac82d419a0647ca2970331f1ff640e.tar.xz rust-openssl-de987f20c8ac82d419a0647ca2970331f1ff640e.zip | |
Revert "Update foreign-types to 0.3"
Diffstat (limited to 'openssl')
| -rw-r--r-- | openssl/Cargo.toml | 2 | ||||
| -rw-r--r-- | openssl/src/bn.rs | 6 | ||||
| -rw-r--r-- | openssl/src/ssl/mod.rs | 7 | ||||
| -rw-r--r-- | openssl/src/x509/mod.rs | 13 |
4 files changed, 27 insertions, 1 deletions
diff --git a/openssl/Cargo.toml b/openssl/Cargo.toml index ded67075..5ed46998 100644 --- a/openssl/Cargo.toml +++ b/openssl/Cargo.toml @@ -20,7 +20,7 @@ v110 = [] [dependencies] bitflags = "0.9" -foreign-types = "0.3" +foreign-types = "0.2" lazy_static = "0.2" libc = "0.2" openssl-sys = { version = "0.9.21", path = "../openssl-sys" } diff --git a/openssl/src/bn.rs b/openssl/src/bn.rs index 82ec38b6..fc6e0bb8 100644 --- a/openssl/src/bn.rs +++ b/openssl/src/bn.rs @@ -1090,6 +1090,12 @@ impl BigNum { } } +impl AsRef<BigNumRef> for BigNum { + fn as_ref(&self) -> &BigNumRef { + self.deref() + } +} + impl fmt::Debug for BigNumRef { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.to_dec_str() { diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index f3f1d219..176863d6 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -76,6 +76,7 @@ use libc::{c_int, c_long, c_ulong, c_void}; use libc::{c_uchar, c_uint}; use std::any::Any; use std::any::TypeId; +use std::borrow::Borrow; use std::cmp; use std::collections::HashMap; use std::ffi::{CStr, CString}; @@ -1025,6 +1026,12 @@ impl Clone for SslSession { } } +impl Borrow<SslSessionRef> for SslSession { + fn borrow(&self) -> &SslSessionRef { + &self + } +} + impl ToOwned for SslSessionRef { type Owned = SslSession; diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index dff65222..db61262c 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -2,6 +2,7 @@ use libc::{c_int, c_long}; use ffi; use foreign_types::{ForeignType, ForeignTypeRef}; +use std::borrow::Borrow; use std::collections::HashMap; use std::error::Error; use std::ffi::{CStr, CString}; @@ -619,12 +620,24 @@ impl Clone for X509 { } } +impl AsRef<X509Ref> for X509 { + fn as_ref(&self) -> &X509Ref { + &*self + } +} + impl AsRef<X509Ref> for X509Ref { fn as_ref(&self) -> &X509Ref { self } } +impl Borrow<X509Ref> for X509 { + fn borrow(&self) -> &X509Ref { + &*self + } +} + impl Stackable for X509 { type StackType = ffi::stack_st_X509; } |