From 491903e1def18b53f6d6a7d1b4af1d1c15bd4b6a Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Fri, 8 Jun 2018 14:21:04 -0400 Subject: [PATCH] Replace mem::transmute() with pointer casts And fix erroneous #[cfg] --- src/geometry/point_conversion.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/geometry/point_conversion.rs b/src/geometry/point_conversion.rs index a26cf35e..5f21063b 100644 --- a/src/geometry/point_conversion.rs +++ b/src/geometry/point_conversion.rs @@ -14,9 +14,6 @@ use base::dimension::{U2, U3}; use std::convert::{AsMut, AsRef, From, Into}; #[cfg(feature = "mint")] use base::storage::{Storage, StorageMut}; -#[cfg(feature = "mint")] -use std::mem; - /* * This file provides the following conversions: * ============================================= @@ -110,7 +107,7 @@ macro_rules! impl_from_into_mint_1D( #[inline] fn as_ref(&self) -> &mint::$PT { unsafe { - mem::transmute(self.coords.data.ptr()) + &*(self.coords.data.ptr() as *const mint::$PT) } } } @@ -120,7 +117,7 @@ macro_rules! impl_from_into_mint_1D( #[inline] fn as_mut(&mut self) -> &mut mint::$PT { unsafe { - mem::transmute(self.coords.data.ptr_mut()) + &mut *(self.coords.data.ptr_mut() as *mut mint::$PT) } } }