From 0129546b5aab2d9331b126558fb4dbd127559363 Mon Sep 17 00:00:00 2001 From: Arlie Davis Date: Mon, 1 Nov 2021 08:55:19 -0700 Subject: [PATCH] Remove `set_abi` from `AbiTransferable` The `set_abi` trait method is defined, but never used. --- src/abi_transferable.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/abi_transferable.rs b/src/abi_transferable.rs index 86801b5..dcd6c65 100644 --- a/src/abi_transferable.rs +++ b/src/abi_transferable.rs @@ -12,8 +12,6 @@ pub unsafe trait AbiTransferable: Sized { /// Turn the type into the FFI ABI type. fn get_abi(&self) -> Self::Abi; - /// Set the abi of the implementing type - fn set_abi(&mut self) -> *mut Self::Abi; /// Convert into a reference to Self from a reference to the ABI fn from_abi(abi: Self::Abi) -> Self { @@ -58,9 +56,6 @@ macro_rules! primitive_transferable_type { fn get_abi(&self) -> Self::Abi { *self } - fn set_abi(&mut self) -> *mut Self::Abi { - self as *mut Self::Abi - } })* }; } @@ -78,6 +73,7 @@ primitive_transferable_type! { f32, f64, usize, + isize, crate::sys::GUID } @@ -86,9 +82,6 @@ unsafe impl AbiTransferable for *mut T { fn get_abi(&self) -> Self::Abi { *self } - fn set_abi(&mut self) -> *mut Self::Abi { - self as *mut Self::Abi - } } unsafe impl AbiTransferable for *const T { @@ -96,9 +89,6 @@ unsafe impl AbiTransferable for *const T { fn get_abi(&self) -> Self::Abi { *self } - fn set_abi(&mut self) -> *mut Self::Abi { - self as *mut Self::Abi - } } unsafe impl AbiTransferable for T { @@ -106,10 +96,6 @@ unsafe impl AbiTransferable for T { fn get_abi(&self) -> Self::Abi { self.as_raw() } - - fn set_abi(&mut self) -> *mut Self::Abi { - &mut self.as_raw() - } } unsafe impl AbiTransferable for Option { @@ -119,11 +105,4 @@ unsafe impl AbiTransferable for Option { .map(|p| p.as_raw().as_ptr()) .unwrap_or(::core::ptr::null_mut()) } - - fn set_abi(&mut self) -> *mut Self::Abi { - &mut self - .as_mut() - .map(|p| p.as_raw().as_ptr()) - .unwrap_or(::core::ptr::null_mut()) - } }