From 4c4b13f23c2c4119b4711591e6596d0110090faf Mon Sep 17 00:00:00 2001 From: mwlon Date: Thu, 1 Aug 2024 08:11:48 -0400 Subject: [PATCH] delete unused functionality --- pco/src/data_types/floats.rs | 8 +++----- pco/src/data_types/mod.rs | 1 - pco/src/read_write_uint.rs | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pco/src/data_types/floats.rs b/pco/src/data_types/floats.rs index dd260ae3..5823d93a 100644 --- a/pco/src/data_types/floats.rs +++ b/pco/src/data_types/floats.rs @@ -80,9 +80,8 @@ fn choose_winning_bid(bids: Vec>) -> Bid { } macro_rules! impl_float_like { - ($t: ty, $latent: ty, $bits: expr, $exp_offset: expr) => { + ($t: ty, $latent: ty, $exp_offset: expr) => { impl FloatLike for $t { - const BITS: Bitlen = $bits; /// Number of bits in the representation of the significand, excluding the implicit /// leading bit. (In Rust, `MANTISSA_DIGITS` does include the implicit leading bit.) const PRECISION_BITS: Bitlen = Self::MANTISSA_DIGITS as Bitlen - 1; @@ -201,7 +200,6 @@ macro_rules! impl_float_like { } impl FloatLike for f16 { - const BITS: Bitlen = 16; const PRECISION_BITS: Bitlen = Self::MANTISSA_DIGITS as Bitlen - 1; const ZERO: Self = f16::ZERO; const MAX_FOR_SAMPLING: Self = f16::from_bits(30719); // Half of MAX size. @@ -391,8 +389,8 @@ macro_rules! impl_float_number_like { }; } -impl_float_like!(f32, u32, 32, 127); -impl_float_like!(f64, u64, 64, 1023); +impl_float_like!(f32, u32, 127); +impl_float_like!(f64, u64, 1023); // f16 FloatLike is implemented separately because it's non-native. impl_float_number_like!(f32, u32, 1_u32 << 31, 5); impl_float_number_like!(f64, u64, 1_u64 << 63, 6); diff --git a/pco/src/data_types/mod.rs b/pco/src/data_types/mod.rs index 30b0ba88..c59054f4 100644 --- a/pco/src/data_types/mod.rs +++ b/pco/src/data_types/mod.rs @@ -38,7 +38,6 @@ pub(crate) trait FloatLike: + SubAssign + Div { - const BITS: Bitlen; /// Number of bits that aren't used for exponent or sign. /// E.g. for f32 this should be 23. const PRECISION_BITS: Bitlen; diff --git a/pco/src/read_write_uint.rs b/pco/src/read_write_uint.rs index 2eaac23d..0a2831cb 100644 --- a/pco/src/read_write_uint.rs +++ b/pco/src/read_write_uint.rs @@ -45,7 +45,6 @@ pub trait ReadWriteUint: + Shr + Sub { - const ZERO: Self; const ONE: Self; const BITS: Bitlen; const MAX_U64S: usize = calc_max_u64s(Self::BITS); @@ -55,7 +54,6 @@ pub trait ReadWriteUint: } impl ReadWriteUint for usize { - const ZERO: Self = 0; const ONE: Self = 1; const BITS: Bitlen = usize::BITS; @@ -71,7 +69,6 @@ impl ReadWriteUint for usize { } impl ReadWriteUint for L { - const ZERO: Self = ::ZERO; const ONE: Self = ::ONE; const BITS: Bitlen = ::BITS;