diff --git a/build.rs b/build.rs index 32f5f92..98b06be 100644 --- a/build.rs +++ b/build.rs @@ -3,7 +3,5 @@ fn main() { ac.emit_expression_cfg("1f64.total_cmp(&2f64)", "has_total_cmp"); // 1.62 - ac.emit_expression_cfg("3.14f64.to_ne_bytes()", "has_float_to_from_bytes"); - autocfg::rerun_path("build.rs"); } diff --git a/src/ops/bytes.rs b/src/ops/bytes.rs index 1351aa6..f6a8030 100644 --- a/src/ops/bytes.rs +++ b/src/ops/bytes.rs @@ -150,7 +150,6 @@ pub trait FromBytes: Sized { macro_rules! float_to_from_bytes_impl { ($T:ty, $L:expr) => { - #[cfg(has_float_to_from_bytes)] impl ToBytes for $T { type Bytes = [u8; $L]; @@ -170,7 +169,6 @@ macro_rules! float_to_from_bytes_impl { } } - #[cfg(has_float_to_from_bytes)] impl FromBytes for $T { type Bytes = [u8; $L]; @@ -189,46 +187,6 @@ macro_rules! float_to_from_bytes_impl { <$T>::from_ne_bytes(*bytes) } } - - #[cfg(not(has_float_to_from_bytes))] - impl ToBytes for $T { - type Bytes = [u8; $L]; - - #[inline] - fn to_be_bytes(&self) -> Self::Bytes { - ToBytes::to_be_bytes(&self.to_bits()) - } - - #[inline] - fn to_le_bytes(&self) -> Self::Bytes { - ToBytes::to_le_bytes(&self.to_bits()) - } - - #[inline] - fn to_ne_bytes(&self) -> Self::Bytes { - ToBytes::to_ne_bytes(&self.to_bits()) - } - } - - #[cfg(not(has_float_to_from_bytes))] - impl FromBytes for $T { - type Bytes = [u8; $L]; - - #[inline] - fn from_be_bytes(bytes: &Self::Bytes) -> Self { - Self::from_bits(FromBytes::from_be_bytes(bytes)) - } - - #[inline] - fn from_le_bytes(bytes: &Self::Bytes) -> Self { - Self::from_bits(FromBytes::from_le_bytes(bytes)) - } - - #[inline] - fn from_ne_bytes(bytes: &Self::Bytes) -> Self { - Self::from_bits(FromBytes::from_ne_bytes(bytes)) - } - } }; }