Fix new clippy lints

This commit is contained in:
wborgeaud 2022-04-29 16:58:41 +02:00
parent 0d118d0f49
commit c505c6759d
3 changed files with 10 additions and 9 deletions

View File

@ -70,13 +70,13 @@ macro_rules! test_prime_field_arithmetic {
mod prime_field_arithmetic {
use std::ops::{Add, Mul, Neg, Sub};
use crate::field_types::{Field, Field64};
use crate::ops::Square;
use $crate::field_types::{Field, Field64};
use $crate::ops::Square;
#[test]
fn arithmetic_addition() {
let modulus = <$field>::ORDER;
crate::prime_field_testing::run_binaryop_test_cases(<$field>::add, |x, y| {
$crate::prime_field_testing::run_binaryop_test_cases(<$field>::add, |x, y| {
((x as u128 + y as u128) % (modulus as u128)) as u64
})
}
@ -84,7 +84,7 @@ macro_rules! test_prime_field_arithmetic {
#[test]
fn arithmetic_subtraction() {
let modulus = <$field>::ORDER;
crate::prime_field_testing::run_binaryop_test_cases(<$field>::sub, |x, y| {
$crate::prime_field_testing::run_binaryop_test_cases(<$field>::sub, |x, y| {
if x >= y {
x - y
} else {
@ -96,7 +96,7 @@ macro_rules! test_prime_field_arithmetic {
#[test]
fn arithmetic_negation() {
let modulus = <$field>::ORDER;
crate::prime_field_testing::run_unaryop_test_cases(<$field>::neg, |x| {
$crate::prime_field_testing::run_unaryop_test_cases(<$field>::neg, |x| {
if x == 0 {
0
} else {
@ -108,7 +108,7 @@ macro_rules! test_prime_field_arithmetic {
#[test]
fn arithmetic_multiplication() {
let modulus = <$field>::ORDER;
crate::prime_field_testing::run_binaryop_test_cases(<$field>::mul, |x, y| {
$crate::prime_field_testing::run_binaryop_test_cases(<$field>::mul, |x, y| {
((x as u128) * (y as u128) % (modulus as u128)) as u64
})
}
@ -116,7 +116,7 @@ macro_rules! test_prime_field_arithmetic {
#[test]
fn arithmetic_square() {
let modulus = <$field>::ORDER;
crate::prime_field_testing::run_unaryop_test_cases(
$crate::prime_field_testing::run_unaryop_test_cases(
|x: $field| x.square(),
|x| ((x as u128 * x as u128) % (modulus as u128)) as u64,
)
@ -130,7 +130,7 @@ macro_rules! test_prime_field_arithmetic {
assert_eq!(zero.try_inverse(), None);
let inputs = crate::prime_field_testing::test_inputs(modulus);
let inputs = $crate::prime_field_testing::test_inputs(modulus);
for x in inputs {
if x != 0 {

View File

@ -21,7 +21,7 @@ pub(crate) fn bench_ldes<F: Field>(c: &mut Criterion) {
let mut group = c.benchmark_group(&format!("lde<{}>", type_name::<F>()));
for size_log in [16] {
for size_log in [13, 14, 15, 16] {
let orig_size = 1 << (size_log - RATE_BITS);
let lde_size = 1 << size_log;

View File

@ -3,6 +3,7 @@
// put it in `src/bin/`, but then we wouldn't have access to
// `[dev-dependencies]`.
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
use std::{num::ParseIntError, ops::RangeInclusive, str::FromStr};