diff --git a/zeroconf/src/ffi/mod.rs b/zeroconf/src/ffi/mod.rs index 6fe23fa..4f771ad 100644 --- a/zeroconf/src/ffi/mod.rs +++ b/zeroconf/src/ffi/mod.rs @@ -17,20 +17,6 @@ pub trait FromRaw { } } -/// Helper trait to convert and clone a raw `*mut c_void` to it's rust type -pub trait CloneRaw + Clone> { - /// Converts and clones the specified `*mut c_void` to a `Box`. - /// - /// # Safety - /// This function is unsafe due to a call to the unsafe function [`FromRaw::from_raw()`]. - /// - /// [`FromRaw::from_raw()`]: trait.FromRaw.html#method.from_raw - unsafe fn clone_raw(raw: *mut c_void) -> Box { - assert_not_null!(raw); - Box::new(T::from_raw(raw).clone()) - } -} - /// Helper trait to convert self to a raw `*mut c_void` pub trait AsRaw { /// Converts self to a raw `*mut c_void` by cast. @@ -51,18 +37,6 @@ impl UnwrapOrNull for Option<*const T> { } } -/// Helper trait to unwrap a type to a `*mut T` or a null-pointer if not present. -pub trait UnwrapMutOrNull { - /// Unwraps this type to `*mut T` or `ptr::null_mut()` if not present. - fn unwrap_mut_or_null(&mut self) -> *mut T; -} - -impl UnwrapMutOrNull for Option<*mut T> { - fn unwrap_mut_or_null(&mut self) -> *mut T { - self.unwrap_or_else(ptr::null_mut) - } -} - #[cfg(target_vendor = "apple")] pub(crate) mod bonjour { use crate::Result;