Skip to content

Commit

Permalink
feat: remove Result from assign_advice return value
Browse files Browse the repository at this point in the history
* apply `cargo clippy --fix`
  • Loading branch information
jonathanpwang committed Feb 10, 2023
1 parent a3b2c14 commit 05a8032
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/tests/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn random_field_tests<F: Field>(type_name: String) {
}

fn random_multiplication_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("multiplication {}", type_name);
let message = format!("multiplication {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -72,7 +72,7 @@ fn random_multiplication_tests<F: Field, R: RngCore>(mut rng: R, type_name: Stri
}

fn random_addition_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("addition {}", type_name);
let message = format!("addition {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -98,7 +98,7 @@ fn random_addition_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_subtraction_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("subtraction {}", type_name);
let message = format!("subtraction {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -119,7 +119,7 @@ fn random_subtraction_tests<F: Field, R: RngCore>(mut rng: R, type_name: String)
}

fn random_negation_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("negation {}", type_name);
let message = format!("negation {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -133,7 +133,7 @@ fn random_negation_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_doubling_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("doubling {}", type_name);
let message = format!("doubling {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -147,7 +147,7 @@ fn random_doubling_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_squaring_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("squaring {}", type_name);
let message = format!("squaring {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -163,7 +163,7 @@ fn random_squaring_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
fn random_inversion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
assert!(bool::from(F::zero().invert().is_none()));

let message = format!("inversion {}", type_name);
let message = format!("inversion {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -176,7 +176,7 @@ fn random_inversion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_expansion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("expansion {}", type_name);
let message = format!("expansion {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
// Compare (a + b)(c + d) and (a*c + b*c + a*d + b*d)
Expand Down Expand Up @@ -215,7 +215,7 @@ pub fn random_serialization_test<F: Field + SerdeObject>(type_name: String) {
0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc,
0xe5,
]);
let message = format!("serialization {}", type_name);
let message = format!("serialization {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand Down

0 comments on commit 05a8032

Please sign in to comment.