Skip to content

Commit

Permalink
Merge pull request #8 from arkworks-rs/clippy-fixes
Browse files Browse the repository at this point in the history
Rest of the clippy fixes
  • Loading branch information
weikengchen committed Oct 29, 2020
2 parents f17309b + 002601c commit 7a37ee0
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 225 deletions.
2 changes: 1 addition & 1 deletion src/fields/nonnative/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
RUSTFLAGS: -Dwarnings --cfg ci
strategy:
matrix:
rust:
Expand Down
4 changes: 2 additions & 2 deletions src/fields/nonnative/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn allocation<TargetField: PrimeField, BaseField: PrimeField, R: RngCore>(

let before = cs.num_constraints();
// there will be a check that ensures it has the reasonable number of bits
NonNativeFieldVar::<TargetField, BaseField>::new_witness(
let _ = NonNativeFieldVar::<TargetField, BaseField>::new_witness(
ark_relations::ns!(cs, "alloc a"),
|| Ok(a_native),
)
Expand Down Expand Up @@ -110,7 +110,7 @@ fn inverse<TargetField: PrimeField, BaseField: PrimeField, R: RngCore>(
.unwrap();

let before = cs.num_constraints();
num.inverse().unwrap();
let _ = num.inverse().unwrap();
let after = cs.num_constraints();

return after - before;
Expand Down
8 changes: 8 additions & 0 deletions src/fields/nonnative/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ use ark_r1cs_std::{alloc::AllocVar, eq::EqGadget, fields::FieldVar, R1CSVar};
use ark_relations::r1cs::{ConstraintSystem, ConstraintSystemRef};
use rand::RngCore;

#[cfg(not(ci))]
const NUM_REPETITIONS: usize = 100;
#[cfg(ci)]
const NUM_REPETITIONS: usize = 1;

#[cfg(not(ci))]
const TEST_COUNT: usize = 100;
#[cfg(ci)]
const TEST_COUNT: usize = 1;

fn allocation_test<TargetField: PrimeField, BaseField: PrimeField, R: RngCore>(
cs: ConstraintSystemRef<BaseField>,
Expand Down Expand Up @@ -680,6 +687,7 @@ nonnative_test!(
<Bls12_381 as PairingEngine>::Fq,
<Bls12_381 as PairingEngine>::Fr
);
#[cfg(not(ci))]
nonnative_test!(
MNT6BigMNT4Small,
<MNT6_753 as PairingEngine>::Fr,
Expand Down

0 comments on commit 7a37ee0

Please sign in to comment.