diff --git a/math/src/field/fields/fft_friendly/babybear.rs b/math/src/field/fields/fft_friendly/babybear.rs index 1dcefc28d..68da03f91 100644 --- a/math/src/field/fields/fft_friendly/babybear.rs +++ b/math/src/field/fields/fft_friendly/babybear.rs @@ -30,18 +30,6 @@ impl FieldElement { } } -impl PartialOrd for FieldElement { - fn partial_cmp(&self, other: &Self) -> Option { - self.representative().partial_cmp(&other.representative()) - } -} - -impl Ord for FieldElement { - fn cmp(&self, other: &Self) -> core::cmp::Ordering { - self.representative().cmp(&other.representative()) - } -} - #[cfg(test)] mod test_babybear_31_bytes_ops { use super::Babybear31PrimeField; diff --git a/math/src/field/fields/fft_friendly/stark_252_prime_field.rs b/math/src/field/fields/fft_friendly/stark_252_prime_field.rs index abea28907..0703a97f6 100644 --- a/math/src/field/fields/fft_friendly/stark_252_prime_field.rs +++ b/math/src/field/fields/fft_friendly/stark_252_prime_field.rs @@ -63,6 +63,7 @@ impl FieldElement { } } +#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)] impl PartialOrd for FieldElement { fn partial_cmp(&self, other: &Self) -> Option { self.representative().partial_cmp(&other.representative()) diff --git a/math/src/unsigned_integer/element.rs b/math/src/unsigned_integer/element.rs index d76e54ec7..fab80ce6f 100644 --- a/math/src/unsigned_integer/element.rs +++ b/math/src/unsigned_integer/element.rs @@ -36,6 +36,7 @@ pub struct UnsignedInteger { // NOTE: manually implementing `PartialOrd` may seem unorthodox, but the // derived implementation had terrible performance. +#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)] impl PartialOrd for UnsignedInteger { fn partial_cmp(&self, other: &Self) -> Option { let mut i = 0;