Skip to content

Commit

Permalink
chore: clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Dec 31, 2024
1 parent 005aa79 commit bfcd071
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 37 deletions.
5 changes: 2 additions & 3 deletions snark-verifier-sdk/src/halo2/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl VerifierUniversality {

#[allow(clippy::type_complexity)]
/// Core function used in `synthesize` to aggregate multiple `snarks`.
///
///
/// Returns the assigned instances of previous snarks and the new final pair that needs to be verified in a pairing check.
/// For each previous snark, we concatenate all instances into a single vector. We return a vector of vectors,
/// one vector per snark, for convenience.
Expand Down Expand Up @@ -360,8 +360,7 @@ pub enum AssignedTranscriptObject {
///
/// ## Notes
/// - This function does _not_ expose any public instances.
/// - `svk` is the generator of the KZG trusted setup, usually gotten via `params.get_g()[0]`
/// (avoids having to pass `params` into function just to get generator)
/// - `svk` is the generator of the KZG trusted setup, usually gotten via `params.get_g()[0]` (avoids having to pass `params` into function just to get generator)
///
/// ## Universality
/// - If `universality` is not `None`, then the verifying keys of each snark in `snarks` is loaded as a witness in the circuit.
Expand Down
2 changes: 1 addition & 1 deletion snark-verifier-sdk/src/halo2/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct AggregationDependencyIntentOwned {
pub agg_vk_hash_data: Option<((usize, usize), Fr)>,
}

impl<'a> AggregationDependencyIntent<'a> {
impl AggregationDependencyIntent<'_> {
/// Converts `self` into `PlonkProtocol`
pub fn compile(self, params: &ParamsKZG<Bn256>) -> PlonkProtocol<G1Affine> {
compile(
Expand Down
25 changes: 0 additions & 25 deletions snark-verifier-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,3 @@ pub fn write_instances(instances: &[&[Fr]], path: impl AsRef<Path>) {
let f = BufWriter::new(File::create(path).unwrap());
bincode::serialize_into(f, &instances).unwrap();
}

#[cfg(feature = "zkevm")]
mod zkevm {
use super::CircuitExt;
use eth_types::Field;
use zkevm_circuits::{evm_circuit::EvmCircuit, state_circuit::StateCircuit};

impl<F: Field> CircuitExt<F> for EvmCircuit<F> {
fn instances(&self) -> Vec<Vec<F>> {
vec![]
}
fn num_instance(&self) -> Vec<usize> {
vec![]
}
}

impl<F: Field> CircuitExt<F> for StateCircuit<F> {
fn instances(&self) -> Vec<Vec<F>> {
vec![]
}
fn num_instance(&self) -> Vec<usize> {
vec![]
}
}
}
2 changes: 1 addition & 1 deletion snark-verifier/src/loader/halo2/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mod halo2_lib {
}
}

impl<'chip, C: CurveAffineExt> EccInstructions<C> for BaseFieldEccChip<'chip, C>
impl<C: CurveAffineExt> EccInstructions<C> for BaseFieldEccChip<'_, C>
where
C::ScalarExt: BigPrimeField,
C::Base: BigPrimeField,
Expand Down
4 changes: 2 additions & 2 deletions snark-verifier/src/pcs/kzg/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ mod halo2 {
use halo2_base::utils::CurveAffineExt;
use halo2_ecc::ecc::BaseFieldEccChip;

impl<'chip, C, const LIMBS: usize, const BITS: usize>
LimbsEncodingInstructions<C, LIMBS, BITS> for BaseFieldEccChip<'chip, C>
impl<C, const LIMBS: usize, const BITS: usize>
LimbsEncodingInstructions<C, LIMBS, BITS> for BaseFieldEccChip<'_, C>
where
C: CurveAffineExt,
C::ScalarExt: BigPrimeField,
Expand Down
2 changes: 1 addition & 1 deletion snark-verifier/src/system/halo2/transcript/halo2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ mod halo2_lib {
use halo2_base::utils::{BigPrimeField, CurveAffineExt};
use halo2_ecc::ecc::BaseFieldEccChip;

impl<'chip, C: CurveAffineExt> NativeEncoding<C> for BaseFieldEccChip<'chip, C>
impl<C: CurveAffineExt> NativeEncoding<C> for BaseFieldEccChip<'_, C>
where
C::Scalar: BigPrimeField,
C::Base: BigPrimeField,
Expand Down
6 changes: 3 additions & 3 deletions snark-verifier/src/util/msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Msm<'a, C: CurveAffine, L: Loader<C>> {
bases: Vec<&'a L::LoadedEcPoint>,
}

impl<'a, C, L> Default for Msm<'a, C, L>
impl<C, L> Default for Msm<'_, C, L>
where
C: CurveAffine,
L: Loader<C>,
Expand Down Expand Up @@ -169,7 +169,7 @@ where
}
}

impl<'a, C, L> MulAssign<&L::LoadedScalar> for Msm<'a, C, L>
impl<C, L> MulAssign<&L::LoadedScalar> for Msm<'_, C, L>
where
C: CurveAffine,
L: Loader<C>,
Expand All @@ -194,7 +194,7 @@ where
}
}

impl<'a, C, L> Sum for Msm<'a, C, L>
impl<C, L> Sum for Msm<'_, C, L>
where
C: CurveAffine,
L: Loader<C>,
Expand Down
2 changes: 1 addition & 1 deletion snark-verifier/src/verifier/plonk/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ where
protocol: &'a PlonkProtocol<C, L>,
common_poly_eval: &CommonPolynomialEvaluation<C, L>,
evaluations: &mut BTreeMap<Query, L::LoadedScalar>,
) -> Result<Vec<Msm<C, L>>, Error> {
) -> Result<Vec<Msm<'a, C, L>>, Error> {
let loader = common_poly_eval.zn().loader();
let mut commitments = iter::empty()
.chain(protocol.preprocessed.iter().map(Msm::base))
Expand Down

0 comments on commit bfcd071

Please sign in to comment.