diff --git a/pairing/src/bls12_381/fq12.rs b/pairing/src/bls12_381/fq12.rs index 7e2751b97..31499b990 100644 --- a/pairing/src/bls12_381/fq12.rs +++ b/pairing/src/bls12_381/fq12.rs @@ -76,7 +76,7 @@ impl Add for Fq12 { type Output = Self; fn add(self, other: Self) -> Self { - self + &other + self.add(&other) } } @@ -108,7 +108,7 @@ impl Sub for Fq12 { type Output = Self; fn sub(self, other: Self) -> Self { - self - &other + self.sub(&other) } } @@ -139,7 +139,7 @@ impl Mul for Fq12 { type Output = Self; fn mul(self, other: Self) -> Self { - self * &other + self.mul(&other) } } diff --git a/pairing/src/bls12_381/fq2.rs b/pairing/src/bls12_381/fq2.rs index 3fb0de3be..8ff85adf3 100644 --- a/pairing/src/bls12_381/fq2.rs +++ b/pairing/src/bls12_381/fq2.rs @@ -90,7 +90,7 @@ impl Add for Fq2 { type Output = Self; fn add(self, other: Self) -> Self { - self + &other + self.add(&other) } } @@ -122,7 +122,7 @@ impl Sub for Fq2 { type Output = Self; fn sub(self, other: Self) -> Self { - self - &other + self.sub(&other) } } @@ -153,7 +153,7 @@ impl Mul for Fq2 { type Output = Self; fn mul(self, other: Self) -> Self { - self * &other + self.mul(&other) } } @@ -309,7 +309,7 @@ fn test_fq2_ordering() { c1: Fq::zero(), }; - let mut b = a.clone(); + let mut b = a; assert!(a.cmp(&b) == Ordering::Equal); b.c0.add_assign(&Fq::one()); diff --git a/pairing/src/bls12_381/fq6.rs b/pairing/src/bls12_381/fq6.rs index 1b3be7f06..bf97825cb 100644 --- a/pairing/src/bls12_381/fq6.rs +++ b/pairing/src/bls12_381/fq6.rs @@ -139,7 +139,7 @@ impl Add for Fq6 { type Output = Self; fn add(self, other: Self) -> Self { - self + &other + self.add(&other) } } @@ -173,7 +173,7 @@ impl Sub for Fq6 { type Output = Self; fn sub(self, other: Self) -> Self { - self - &other + self.sub(&other) } } @@ -205,7 +205,7 @@ impl Mul for Fq6 { type Output = Self; fn mul(self, other: Self) -> Self { - self * &other + self.mul(&other) } } diff --git a/pairing/src/tests/field.rs b/pairing/src/tests/field.rs index cd352a9ae..7ddb36534 100644 --- a/pairing/src/tests/field.rs +++ b/pairing/src/tests/field.rs @@ -9,7 +9,7 @@ pub fn random_frobenius_tests>(characteristic: C, maxp ]); for _ in 0..100 { - for i in 0..(maxpower + 1) { + for i in 0..=maxpower { let mut a = F::random(&mut rng); let mut b = a; diff --git a/pairing/src/tests/repr.rs b/pairing/src/tests/repr.rs index 67badd802..cde3ab3bc 100644 --- a/pairing/src/tests/repr.rs +++ b/pairing/src/tests/repr.rs @@ -68,7 +68,7 @@ fn random_shl_tests() { for _ in 0..100 { let r = P::random(&mut rng).into_repr(); - for shift in 0..(r.num_bits() + 1) { + for shift in 0..=r.num_bits() { let mut r1 = r; let mut r2 = r; @@ -92,7 +92,7 @@ fn random_shr_tests() { for _ in 0..100 { let r = P::random(&mut rng).into_repr(); - for shift in 0..(r.num_bits() + 1) { + for shift in 0..=r.num_bits() { let mut r1 = r; let mut r2 = r;