Remove Opaque
This commit is contained in:
parent
cd7fa9fca2
commit
96a77cf5a8
|
|
@ -59,7 +59,6 @@ macro_rules! type_ {
|
|||
}
|
||||
|
||||
mod bio;
|
||||
mod opaque;
|
||||
mod util;
|
||||
pub mod asn1;
|
||||
pub mod bn;
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
use std::cell::UnsafeCell;
|
||||
|
||||
/// This is intended to be used as the inner type for types designed to be pointed to by references
|
||||
/// converted from raw C pointers. It has an `UnsafeCell` internally to inform the compiler about
|
||||
/// aliasability and doesn't implement `Copy`, so it can't be dereferenced.
|
||||
pub struct Opaque(UnsafeCell<()>);
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
use std::cell::UnsafeCell;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use opaque::Opaque;
|
||||
|
||||
pub unsafe trait OpenSslType {
|
||||
type CType;
|
||||
|
||||
|
|
@ -10,7 +9,7 @@ pub unsafe trait OpenSslType {
|
|||
fn as_ptr(&self) -> *mut Self::CType;
|
||||
}
|
||||
|
||||
pub struct Ref<T>(Opaque, PhantomData<T>);
|
||||
pub struct Ref<T>(UnsafeCell<()>, PhantomData<T>);
|
||||
|
||||
impl<T: OpenSslType> Ref<T> {
|
||||
pub unsafe fn from_ptr<'a>(ptr: *mut T::CType) -> &'a Ref<T> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue