diff --git a/openssl/src/md.rs b/openssl/src/md.rs index 70796759f..29b226b46 100644 --- a/openssl/src/md.rs +++ b/openssl/src/md.rs @@ -31,32 +31,6 @@ cfg_if! { } } - impl ForeignType for Md { - type CType = ffi::EVP_MD; - type Ref = MdRef; - - #[inline] - unsafe fn from_ptr(ptr: *mut Self::CType) -> Self { - Md(ptr) - } - - #[inline] - fn as_ptr(&self) -> *mut Self::CType { - self.0 - } - } - - impl Deref for Md { - type Target = MdRef; - - #[inline] - fn deref(&self) -> &Self::Target { - unsafe { - MdRef::from_ptr(self.as_ptr()) - } - } - } - impl DerefMut for Md { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { @@ -70,6 +44,30 @@ cfg_if! { } } +impl ForeignType for Md { + type CType = ffi::EVP_MD; + type Ref = MdRef; + + #[inline] + unsafe fn from_ptr(ptr: *mut Self::CType) -> Self { + Md(ptr) + } + + #[inline] + fn as_ptr(&self) -> *mut Self::CType { + self.0 + } +} + +impl Deref for Md { + type Target = MdRef; + + #[inline] + fn deref(&self) -> &Self::Target { + unsafe { MdRef::from_ptr(self.as_ptr()) } + } +} + /// A message digest algorithm. pub struct Md(Inner);