diff --git a/k256/src/arithmetic/field.rs b/k256/src/arithmetic/field.rs index aff92693..c996cc71 100644 --- a/k256/src/arithmetic/field.rs +++ b/k256/src/arithmetic/field.rs @@ -485,7 +485,7 @@ impl Neg for &FieldElement { impl Sum for FieldElement { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -498,7 +498,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement { impl Product for FieldElement { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/k256/src/arithmetic/scalar.rs b/k256/src/arithmetic/scalar.rs index 0d9f814a..6798ba88 100644 --- a/k256/src/arithmetic/scalar.rs +++ b/k256/src/arithmetic/scalar.rs @@ -713,7 +713,7 @@ impl ReduceNonZero for Scalar { impl Sum for Scalar { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -725,7 +725,7 @@ impl<'a> Sum<&'a Scalar> for Scalar { impl Product for Scalar { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/p256/src/arithmetic/field.rs b/p256/src/arithmetic/field.rs index ddca0897..61f3e89f 100644 --- a/p256/src/arithmetic/field.rs +++ b/p256/src/arithmetic/field.rs @@ -478,7 +478,7 @@ impl Neg for &FieldElement { impl Sum for FieldElement { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -490,7 +490,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement { impl Product for FieldElement { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/p256/src/arithmetic/scalar.rs b/p256/src/arithmetic/scalar.rs index f7de1a2f..9642cd70 100644 --- a/p256/src/arithmetic/scalar.rs +++ b/p256/src/arithmetic/scalar.rs @@ -676,7 +676,7 @@ impl ReduceNonZero for Scalar { impl Sum for Scalar { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -688,7 +688,7 @@ impl<'a> Sum<&'a Scalar> for Scalar { impl Product for Scalar { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/p521/src/arithmetic/field.rs b/p521/src/arithmetic/field.rs index c8d32915..4ec1654b 100644 --- a/p521/src/arithmetic/field.rs +++ b/p521/src/arithmetic/field.rs @@ -614,7 +614,7 @@ impl Neg for FieldElement { impl Sum for FieldElement { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -626,7 +626,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement { impl Product for FieldElement { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/p521/src/arithmetic/scalar.rs b/p521/src/arithmetic/scalar.rs index 159152be..8ec6c5cf 100644 --- a/p521/src/arithmetic/scalar.rs +++ b/p521/src/arithmetic/scalar.rs @@ -18,7 +18,7 @@ use self::scalar_impl::*; use crate::{FieldBytes, NistP521, SecretKey, U576}; use core::{ iter::{Product, Sum}, - ops::{AddAssign, MulAssign, Neg, Shr, ShrAssign, SubAssign}, + ops::{Add, AddAssign, Mul, MulAssign, Neg, Shr, ShrAssign, SubAssign}, }; use elliptic_curve::{ array::Array, @@ -43,7 +43,7 @@ use {crate::ScalarBits, elliptic_curve::group::ff::PrimeFieldBits}; use serdect::serde::{de, ser, Deserialize, Serialize}; #[cfg(doc)] -use core::ops::{Add, Mul, Sub}; +use core::ops::Sub; #[cfg(target_pointer_width = "32")] use super::util::{u32x18_to_u64x9, u64x9_to_u32x18}; @@ -474,7 +474,7 @@ impl Neg for Scalar { impl Sum for Scalar { fn sum>(iter: I) -> Self { - iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) + iter.reduce(Add::add).unwrap_or(Self::ZERO) } } @@ -486,7 +486,7 @@ impl<'a> Sum<&'a Scalar> for Scalar { impl Product for Scalar { fn product>(iter: I) -> Self { - iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) + iter.reduce(Mul::mul).unwrap_or(Self::ONE) } } diff --git a/primefield/src/lib.rs b/primefield/src/lib.rs index d63fdebc..14e042e1 100644 --- a/primefield/src/lib.rs +++ b/primefield/src/lib.rs @@ -452,6 +452,7 @@ macro_rules! impl_mont_field_element_arithmetic { } impl Sum for $fe { + #[allow(unused_qualifications)] fn sum>(iter: I) -> Self { iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) } @@ -464,6 +465,7 @@ macro_rules! impl_mont_field_element_arithmetic { } impl Product for $fe { + #[allow(unused_qualifications)] fn product>(iter: I) -> Self { iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) } diff --git a/primeorder/src/field.rs b/primeorder/src/field.rs index 44070228..7c2291ac 100644 --- a/primeorder/src/field.rs +++ b/primeorder/src/field.rs @@ -442,6 +442,7 @@ macro_rules! impl_mont_field_element_arithmetic { } impl Sum for $fe { + #[allow(unused_qualifications)] fn sum>(iter: I) -> Self { iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO) } @@ -454,6 +455,7 @@ macro_rules! impl_mont_field_element_arithmetic { } impl Product for $fe { + #[allow(unused_qualifications)] fn product>(iter: I) -> Self { iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE) }