Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused qualifications warnings #1053

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions k256/src/arithmetic/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ impl Neg for &FieldElement {

impl Sum for FieldElement {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -498,7 +498,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement {

impl Product for FieldElement {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
4 changes: 2 additions & 2 deletions k256/src/arithmetic/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ impl ReduceNonZero<U512> for Scalar {

impl Sum for Scalar {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -725,7 +725,7 @@ impl<'a> Sum<&'a Scalar> for Scalar {

impl Product for Scalar {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
4 changes: 2 additions & 2 deletions p256/src/arithmetic/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ impl Neg for &FieldElement {

impl Sum for FieldElement {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -490,7 +490,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement {

impl Product for FieldElement {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
4 changes: 2 additions & 2 deletions p256/src/arithmetic/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ impl ReduceNonZero<U256> for Scalar {

impl Sum for Scalar {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -688,7 +688,7 @@ impl<'a> Sum<&'a Scalar> for Scalar {

impl Product for Scalar {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
4 changes: 2 additions & 2 deletions p521/src/arithmetic/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ impl Neg for FieldElement {

impl Sum for FieldElement {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -626,7 +626,7 @@ impl<'a> Sum<&'a FieldElement> for FieldElement {

impl Product for FieldElement {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
8 changes: 4 additions & 4 deletions p521/src/arithmetic/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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};
Expand Down Expand Up @@ -474,7 +474,7 @@ impl Neg for Scalar {

impl Sum for Scalar {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
iter.reduce(Add::add).unwrap_or(Self::ZERO)
}
}

Expand All @@ -486,7 +486,7 @@ impl<'a> Sum<&'a Scalar> for Scalar {

impl Product for Scalar {
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
iter.reduce(Mul::mul).unwrap_or(Self::ONE)
}
}

Expand Down
2 changes: 2 additions & 0 deletions primefield/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ macro_rules! impl_mont_field_element_arithmetic {
}

impl Sum for $fe {
#[allow(unused_qualifications)]
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
}
Expand All @@ -464,6 +465,7 @@ macro_rules! impl_mont_field_element_arithmetic {
}

impl Product for $fe {
#[allow(unused_qualifications)]
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
}
Expand Down
2 changes: 2 additions & 0 deletions primeorder/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ macro_rules! impl_mont_field_element_arithmetic {
}

impl Sum for $fe {
#[allow(unused_qualifications)]
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Add::add).unwrap_or(Self::ZERO)
}
Expand All @@ -454,6 +455,7 @@ macro_rules! impl_mont_field_element_arithmetic {
}

impl Product for $fe {
#[allow(unused_qualifications)]
fn product<I: Iterator<Item = Self>>(iter: I) -> Self {
iter.reduce(core::ops::Mul::mul).unwrap_or(Self::ONE)
}
Expand Down
Loading