diff options
author | Andrew Gallant <jamslam@gmail.com> | 2017-07-08 10:03:15 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-07-08 10:03:15 -0400 |
commit | ee399d53e88950c025b1cd1b3bdbe0571df95efc (patch) | |
tree | 564122c07f3eeea80e6d86b44560b7cd6f771dec /src | |
parent | 6136293b6cc3226a477d7c1597d39163242c128d (diff) | |
download | byteorder-ee399d53e88950c025b1cd1b3bdbe0571df95efc.tar.gz |
floats: remove unnecessary transmute
Thanks @le-jzr!
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1172,7 +1172,7 @@ fn safe_u32_bits_to_f32(u: u32) -> f32 { // NaNs differently. Therefore, to be safe, we pass a known quiet // NaN if u is any kind of NaN. The check above only assumes // IEEE 754-1985 to be valid. - unsafe { transmute(NAN) } + NAN } else { unsafe { transmute(u) } } @@ -1191,7 +1191,7 @@ fn safe_u64_bits_to_f64(u: u64) -> f64 { // NaNs differently. Therefore, to be safe, we pass a known quiet // NaN if u is any kind of NaN. The check above only assumes // IEEE 754-1985 to be valid. - unsafe { transmute(NAN) } + NAN } else { unsafe { transmute(u) } } |