Skip to content

Commit

Permalink
Make Clippy happy for 1.79
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems committed Jan 8, 2025
1 parent b6b7552 commit ce24185
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
12 changes: 4 additions & 8 deletions ivc/src/ivc/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,11 @@ pub fn build_fixed_selectors<const N_COL_TOTAL: usize, const N_CHALS: usize>(
}

for i in N_BLOCKS..N_FSEL_IVC - N_BLOCKS {
PoseidonBN254Parameters
.constants()
.iter()
.enumerate()
.for_each(|(_round, rcs)| {
rcs.iter().enumerate().for_each(|(_state_index, rc)| {
selectors[i] = vec![*rc; domain_size];
});
PoseidonBN254Parameters.constants().iter().for_each(|rcs| {
rcs.iter().for_each(|rc| {
selectors[i] = vec![*rc; domain_size];
});
});
}

selectors
Expand Down
5 changes: 4 additions & 1 deletion kimchi/src/circuits/polynomials/foreign_field_add/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ pub fn create_chain<F: PrimeField>(
// Make sure that the inputs are smaller than the modulus just in case
let inputs: Vec<BigUint> = inputs.iter().map(|input| input % modulus.clone()).collect();

let mut witness = array::from_fn(|_| vec![F::zero(); 0]);
let mut witness = array::from_fn(|_| {
F::zero();
vec![] as std::vec::Vec<F>
});

let foreign_modulus = ForeignElement::from_biguint(modulus);

Expand Down
5 changes: 4 additions & 1 deletion kimchi/src/circuits/polynomials/foreign_field_mul/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ pub fn create<F: PrimeField>(
right_input: &BigUint,
foreign_field_modulus: &BigUint,
) -> ([Vec<F>; COLUMNS], ExternalChecks<F>) {
let mut witness = array::from_fn(|_| vec![F::zero(); 0]);
let mut witness = array::from_fn(|_| {
F::zero();
vec![] as std::vec::Vec<F>
});
let mut external_checks = ExternalChecks::<F>::default();

// Compute quotient and remainder using foreign field modulus
Expand Down
3 changes: 1 addition & 2 deletions kimchi/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,7 @@ where
index_evals.extend(
foreign_field_mul::gadget::circuit_gates()
.iter()
.enumerate()
.map(|(_, gate_type)| (*gate_type, selector)),
.map(|gate_type| (*gate_type, selector)),
);
}

Expand Down
6 changes: 4 additions & 2 deletions kimchi/src/tests/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ fn create_keccak_witness<G: KimchiCurve>(message: BigUint) -> [Vec<G::ScalarFiel
where
G::BaseField: PrimeField,
{
let mut witness: [Vec<G::ScalarField>; KECCAK_COLS] =
array::from_fn(|_| vec![G::ScalarField::zero(); 0]);
let mut witness: [Vec<G::ScalarField>; KECCAK_COLS] = array::from_fn(|_| {
G::ScalarField::zero();
vec![] as std::vec::Vec<<G as ark_ec::AffineRepr>::ScalarField>
});
extend_keccak_witness(&mut witness, message);
// Adding dummy row to avoid out of bounds in squeeze constraints accessing Next row
let dummy_row: [Vec<G::ScalarField>; KECCAK_COLS] =
Expand Down
2 changes: 1 addition & 1 deletion o1vm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ mod tests {
assert_eq!(memory_size(1024_usize), "1.0 KiB");
assert_eq!(memory_size(1024 * 1024_usize), "1.0 MiB");
assert_eq!(memory_size(2100 * 1024 * 1024_usize), "2.1 GiB");
assert_eq!(memory_size(std::usize::MAX), "16.0 EiB");
assert_eq!(memory_size(usize::MAX), "16.0 EiB");
}
}

0 comments on commit ce24185

Please sign in to comment.