From a34ad7d15f7985c066e4ce39578ea0f48e5229c9 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 5 Oct 2018 12:28:32 +0700 Subject: [PATCH] clippy: Use f32::from_bits(). --- nalgebra-glm/src/common.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nalgebra-glm/src/common.rs b/nalgebra-glm/src/common.rs index 06d90813..e038046c 100644 --- a/nalgebra-glm/src/common.rs +++ b/nalgebra-glm/src/common.rs @@ -220,7 +220,7 @@ pub fn fract(x: &TVec) -> TVec /// * [`uint_bits_to_float`](fn.uint_bits_to_float.html) /// * [`uint_bits_to_float_scalar`](fn.uint_bits_to_float_scalar.html) pub fn int_bits_to_float(v: i32) -> f32 { - unsafe { mem::transmute(v) } + f32::from_bits(v as u32) } @@ -409,7 +409,7 @@ pub fn trunc(x: &TVec) -> TVec /// * [`int_bits_to_float_vec`](fn.int_bits_to_float_vec.html) /// * [`uint_bits_to_float`](fn.uint_bits_to_float.html) pub fn uint_bits_to_float_scalar(v: u32) -> f32 { - unsafe { mem::transmute(v) } + f32::from_bits(v) }