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/src/x509 | |
| 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/src/x509')
| -rw-r--r-- | openssl/src/x509/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |