Merge pull request #2 from zcash/clippy-fixes

Clippy fixes
This commit is contained in:
str4d 2021-03-05 11:44:01 +13:00 committed by GitHub
commit 0a6b2f6eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 13 deletions

View file

@ -427,6 +427,7 @@ macro_rules! new_curve_impl {
}
}
#[allow(clippy::suspicious_arithmetic_impl)]
impl<'a, 'b> Mul<&'b $scalar> for &'a $name {
type Output = $name;
@ -537,6 +538,7 @@ macro_rules! new_curve_impl {
}
}
#[allow(clippy::suspicious_arithmetic_impl)]
impl<'a, 'b> Mul<&'b $scalar> for &'a $name_affine {
type Output = $name;
@ -730,13 +732,13 @@ macro_rules! new_curve_impl {
Self::identity()
}
fn group_add(&mut self, rhs: &Self) {
*self = *self + *rhs;
*self += *rhs;
}
fn group_sub(&mut self, rhs: &Self) {
*self = *self - *rhs;
*self -= *rhs;
}
fn group_scale(&mut self, by: &Self::Scalar) {
*self = *self * (*by);
*self *= *by;
}
}
};

View file

@ -307,6 +307,7 @@ impl Fp {
Fp::montgomery_reduce(r0, r1, r2, r3, r4, r5, r6, r7)
}
#[allow(clippy::too_many_arguments)]
#[inline(always)]
const fn montgomery_reduce(
r0: u64,
@ -451,13 +452,13 @@ impl Group for Fp {
Self::zero()
}
fn group_add(&mut self, rhs: &Self) {
*self = *self + *rhs;
*self += *rhs;
}
fn group_sub(&mut self, rhs: &Self) {
*self = *self - *rhs;
*self -= *rhs;
}
fn group_scale(&mut self, by: &Self::Scalar) {
*self = *self * (*by);
*self *= *by;
}
}

View file

@ -307,6 +307,7 @@ impl Fq {
Fq::montgomery_reduce(r0, r1, r2, r3, r4, r5, r6, r7)
}
#[allow(clippy::too_many_arguments)]
#[inline(always)]
const fn montgomery_reduce(
r0: u64,
@ -451,13 +452,13 @@ impl Group for Fq {
Self::zero()
}
fn group_add(&mut self, rhs: &Self) {
*self = *self + *rhs;
*self += *rhs;
}
fn group_sub(&mut self, rhs: &Self) {
*self = *self - *rhs;
*self -= *rhs;
}
fn group_scale(&mut self, by: &Self::Scalar) {
*self = *self * (*by);
*self *= *by;
}
}

View file

@ -99,6 +99,7 @@ pub fn iso_map<F: FieldExt, C: CurveExt<Base = F>, I: CurveExt<Base = F>>(
C::new_jacobian(xo, yo, zo).unwrap()
}
#[allow(clippy::many_single_char_names)]
pub fn map_to_curve_simple_swu<F: FieldExt, C: CurveExt<Base = F>, I: CurveExt<Base = F>>(
u: &F,
theta: F,

View file

@ -4,10 +4,6 @@
#![allow(unknown_lints)]
#![allow(
clippy::op_ref,
clippy::assign_op_pattern,
clippy::too_many_arguments,
clippy::suspicious_arithmetic_impl,
clippy::many_single_char_names,
clippy::same_item_push,
clippy::upper_case_acronyms,
clippy::unknown_clippy_lints

View file

@ -15,6 +15,7 @@ pub type Point = Ep;
pub type Affine = EpAffine;
#[test]
#[allow(clippy::many_single_char_names)]
fn test_iso_map() {
use crate::arithmetic::CurveExt;
use group::Group;