From 1f9430399e855e0d9a6aff89e9212492706f0f29 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Sun, 15 Jun 2014 10:57:09 -0700 Subject: [PATCH] Fix transmute build failure Closes #87 --- src/cgmath/plane.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cgmath/plane.rs b/src/cgmath/plane.rs index 9f82837..63ff2d0 100644 --- a/src/cgmath/plane.rs +++ b/src/cgmath/plane.rs @@ -13,7 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::mem::transmute; use std::fmt; use std::num::Zero; @@ -67,7 +66,9 @@ impl Plane { /// Construct a plane from the components of a four-dimensional vector pub fn from_vector4(v: Vector4) -> Plane { - unsafe { transmute(v) } + match v { + Vector4 { x, y, z, w } => Plane { n: Vector3::new(x, y, z), d: w }, + } } /// Constructs a plane that passes through the the three points `a`, `b` and `c`