Skip to content

Commit

Permalink
Make Clippy happy for 1.76
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Jan 8, 2025
1 parent 5f36086 commit 4f9350f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn compute_ffadd_values<F: PrimeField>(
/// opcode: true for addition, false for subtraction
/// modulus: modulus of the foreign field
pub fn create_chain<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand Down
12 changes: 6 additions & 6 deletions kimchi/src/tests/foreign_field_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ fn full_circuit<F: PrimeField>(

// Creates the witness with the public input for FFAdd containing the 1 value
fn short_witness<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand All @@ -277,7 +277,7 @@ fn short_witness<F: PrimeField>(
// opcode: true for addition, false for subtraction
// modulus: modulus of the foreign field
fn long_witness<F: PrimeField>(
inputs: &Vec<BigUint>,
inputs: &[BigUint],
opcodes: &[FFOps],
modulus: BigUint,
) -> [Vec<F>; COLUMNS] {
Expand Down Expand Up @@ -1406,7 +1406,7 @@ where

// Compute addition witness
let witness = short_witness(
&vec![left_input, right_input],
&[left_input, right_input],
&[FFOps::Add],
foreign_field_modulus.clone(),
);
Expand Down Expand Up @@ -1481,7 +1481,7 @@ fn test_ffadd_finalization() {
let left = modulus.clone() - BigUint::one();
let right = modulus.clone() - BigUint::one();
// create a chain of 1 addition
let add_witness = witness::create_chain::<Fp>(&vec![left, right], operation, modulus);
let add_witness = witness::create_chain::<Fp>(&[left, right], operation, modulus);
for col in 0..COLUMNS {
witness[col].extend(add_witness[col].iter());
}
Expand Down Expand Up @@ -1553,7 +1553,7 @@ fn test_gate_invalid_foreign_field_modulus() {
#[test]
fn test_witness_max_foreign_field_modulus() {
short_witness::<PallasField>(
&vec![BigUint::zero(), BigUint::zero()],
&[BigUint::zero(), BigUint::zero()],
&[FFOps::Add],
BigUint::max_foreign_field_modulus::<PallasField>(),
);
Expand All @@ -1563,7 +1563,7 @@ fn test_witness_max_foreign_field_modulus() {
#[should_panic]
fn test_witness_invalid_foreign_field_modulus() {
short_witness::<PallasField>(
&vec![BigUint::zero(), BigUint::zero()],
&[BigUint::zero(), BigUint::zero()],
&[FFOps::Add],
BigUint::max_foreign_field_modulus::<PallasField>() + BigUint::one(),
);
Expand Down
4 changes: 2 additions & 2 deletions msm/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn prove<
>(
domain: EvaluationDomains<G::ScalarField>,
srs: &OpeningProof::SRS,
constraints: &Vec<E<G::ScalarField>>,
constraints: &[E<G::ScalarField>],
fixed_selectors: Box<[Vec<G::ScalarField>; N_FSEL]>,
inputs: ProofInputs<N_WIT, G::ScalarField, ID>,
rng: &mut RNG,
Expand Down Expand Up @@ -288,7 +288,7 @@ where

// Compute ∑ α^i constraint_i as an expression
let combined_expr =
Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone());
Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec());

// We want to compute the quotient polynomial, i.e.
// t(X) = (∑ α^i constraint_i(X)) / Z_H(X).
Expand Down
4 changes: 2 additions & 2 deletions msm/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn verify<
>(
domain: EvaluationDomains<G::ScalarField>,
srs: &OpeningProof::SRS,
constraints: &Vec<E<G::ScalarField>>,
constraints: &[E<G::ScalarField>],
fixed_selectors: Box<[Vec<G::ScalarField>; N_FSEL]>,
proof: &Proof<N_WIT, N_REL, N_DSEL, N_FSEL, G, OpeningProof, ID>,
public_inputs: Witness<NPUB, Vec<G::ScalarField>>,
Expand Down Expand Up @@ -286,7 +286,7 @@ where
};

let combined_expr =
Expr::combine_constraints(0..(constraints.len() as u32), constraints.clone());
Expr::combine_constraints(0..(constraints.len() as u32), constraints.to_vec());
// Note the minus! ft polynomial at zeta (ft_eval0) is minus evaluation of the expression.
let ft_eval0 = -PolishToken::evaluate(
combined_expr.to_polish().as_slice(),
Expand Down
1 change: 0 additions & 1 deletion mvpoly/src/pbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
//! use mvpoly::prime::Dense;
//! use mina_curves::pasta::Fp;
//!
//! #[test]
//! fn test_mul_by_one() {
//! mvpoly::pbt::test_mul_by_one::<Fp, 2, 2, Dense<Fp, 2, 2>>();
//! mvpoly::pbt::test_mul_by_one::<Fp, 4, 2, Dense<Fp, 4, 2>>();
Expand Down
4 changes: 2 additions & 2 deletions poly-commitment/src/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use std::ops::Neg;
/// P2_1(ζ) + P2_2(ζ) * polyscale + P2_1(ζω) polyscale^2 + P2_2(ζω) * polyscale^3
/// ```
pub fn combine_evaluations<G: CommitmentCurve>(
evaluations: &Vec<Evaluation<G>>,
evaluations: &[Evaluation<G>],
polyscale: G::ScalarField,
) -> Vec<G::ScalarField> {
let mut polyscale_i = G::ScalarField::one();
Expand Down Expand Up @@ -432,7 +432,7 @@ impl<
pub fn verify(
&self,
srs: &PairingSRS<Pair>, // SRS
evaluations: &Vec<Evaluation<G>>, // commitments to the polynomials
evaluations: &[Evaluation<G>], // commitments to the polynomials
polyscale: F, // scaling factor for polynoms
elm: &[F], // vector of evaluation points
) -> bool {
Expand Down
8 changes: 4 additions & 4 deletions poly-commitment/tests/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1], polyscale);
// We have 2 evaluation points.
assert_eq!(output.len(), 2);
// polyscale is not used.
Expand All @@ -60,7 +60,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
// polyscale is not used.
Expand Down Expand Up @@ -92,7 +92,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1, eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1, eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
let exp_output = [Fp::from(1 + 3 * 2), Fp::from(2 + 4 * 2)];
Expand Down Expand Up @@ -123,7 +123,7 @@ fn test_combine_evaluations() {
],
};

let output = combine_evaluations::<VestaG>(&vec![eval_p1, eval_p2], polyscale);
let output = combine_evaluations::<VestaG>(&[eval_p1, eval_p2], polyscale);
// We have 2 evaluation points
assert_eq!(output.len(), 2);
let o1 = Fp::from(1 + 3 * 2 + 5 * 4 + 7 * 8);
Expand Down

0 comments on commit 4f9350f

Please sign in to comment.