From 17e08808837982c02c24067e507af864c8cff7e8 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Fri, 24 Nov 2023 14:13:26 +1100 Subject: [PATCH] Lints generally exist for a good reason --- src/ff/boolean_array.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ff/boolean_array.rs b/src/ff/boolean_array.rs index a69bb86ae..3e7feae09 100644 --- a/src/ff/boolean_array.rs +++ b/src/ff/boolean_array.rs @@ -192,16 +192,14 @@ macro_rules! boolean_array_impl { } } - #[allow(clippy::from_over_into)] - impl Into for $name { + impl From<$name> for u128 { /// Infallible conversion from this data type to `u128`. We assume that the /// inner value is at most 128-bit long. That is, the integer value must be /// less than or equal to `2^Self::BITS`. Should be long enough for our use /// case. - fn into(self) -> u128 { + fn from(v: $name) -> u128 { debug_assert!(<$name>::BITS <= 128); - self.0 - .iter() + v.0.iter() .by_refs() .enumerate() .fold(0_u128, |acc, (i, b)| acc + ((*b as u128) << i))