From a569591c8e7cd220a4c65fecc1dc2e23787922e1 Mon Sep 17 00:00:00 2001 From: David Koloski Date: Sun, 8 Sep 2024 22:26:56 -0400 Subject: [PATCH] Silence nightly transmute lints --- src/common.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common.rs b/src/common.rs index 5c2f015..89dc3c2 100644 --- a/src/common.rs +++ b/src/common.rs @@ -130,12 +130,14 @@ macro_rules! impl_float { use core::mem::transmute; // `transmute` is used here because `from_bits` and `to_bits` - // are not stably const as of 1.72.0. + // are not stably const as of 1.81.0. + #[allow(clippy::transmute_float_to_int)] // SAFETY: `$prim` and `$prim_int` have the same size and all // bit patterns are valid for both. let value = unsafe { transmute::<$prim, $prim_int>(value) }; let value = swap_endian!($endian value); + #[allow(clippy::transmute_int_to_float)] // SAFETY: `$prim` and `$prim_int` have the same size and all // bit patterns are valid for both. let value = unsafe { transmute::<$prim_int, $prim>(value) }; @@ -152,12 +154,14 @@ macro_rules! impl_float { use core::mem::transmute; // `transmute` is used here because `from_bits` and `to_bits` - // are not stably const as of 1.72.0. + // are not stably const as of 1.81.0. + #[allow(clippy::transmute_float_to_int)] // SAFETY: `$prim` and `$prim_int` have the same size and all // bit patterns are valid for both. let value = unsafe { transmute::<$prim, $prim_int>(self.0) }; let value = swap_endian!($endian value); + #[allow(clippy::transmute_int_to_float)] // SAFETY: `$prim` and `$prim_int` have the same size and all // bit patterns are valid for both. unsafe { transmute::<$prim_int, $prim>(value) }