mirror of https://github.com/zcash/halo2.git
Remove needless borrows that are immediately dereferenced:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
ffe87e1fef
commit
209144981a
|
@ -489,7 +489,7 @@ impl<F: FieldExt> MockProver<F> {
|
||||||
// every selector is explicitly enabled or disabled on every row? But that
|
// every selector is explicitly enabled or disabled on every row? But that
|
||||||
// seems messy and confusing.
|
// seems messy and confusing.
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.filter(move |(_, g)| g.queried_selectors().contains(&selector))
|
.filter(move |(_, g)| g.queried_selectors().contains(selector))
|
||||||
.flat_map(move |(gate_index, gate)| {
|
.flat_map(move |(gate_index, gate)| {
|
||||||
at.iter().flat_map(move |selector_row| {
|
at.iter().flat_map(move |selector_row| {
|
||||||
// Selectors are queried with no rotation.
|
// Selectors are queried with no rotation.
|
||||||
|
|
|
@ -173,7 +173,7 @@ impl<F: FieldExt> Argument<F> {
|
||||||
let commit_values = |values: &Polynomial<C::Scalar, LagrangeCoeff>| {
|
let commit_values = |values: &Polynomial<C::Scalar, LagrangeCoeff>| {
|
||||||
let poly = pk.vk.domain.lagrange_to_coeff(values.clone());
|
let poly = pk.vk.domain.lagrange_to_coeff(values.clone());
|
||||||
let blind = Blind(C::Scalar::rand());
|
let blind = Blind(C::Scalar::rand());
|
||||||
let commitment = params.commit_lagrange(&values, blind).to_affine();
|
let commitment = params.commit_lagrange(values, blind).to_affine();
|
||||||
(poly, blind, commitment)
|
(poly, blind, commitment)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ fn permute_expression_pair<C: CurveAffine>(
|
||||||
if row == 0 || *input_value != permuted_input_expression[row - 1] {
|
if row == 0 || *input_value != permuted_input_expression[row - 1] {
|
||||||
*table_value = *input_value;
|
*table_value = *input_value;
|
||||||
// Remove one instance of input_value from leftover_table_map
|
// Remove one instance of input_value from leftover_table_map
|
||||||
if let Some(count) = leftover_table_map.get_mut(&input_value) {
|
if let Some(count) = leftover_table_map.get_mut(input_value) {
|
||||||
assert!(*count > 0);
|
assert!(*count > 0);
|
||||||
*count -= 1;
|
*count -= 1;
|
||||||
None
|
None
|
||||||
|
|
|
@ -276,13 +276,13 @@ pub fn create_proof<
|
||||||
.iter()
|
.iter()
|
||||||
.map(|lookup| {
|
.map(|lookup| {
|
||||||
lookup.commit_permuted(
|
lookup.commit_permuted(
|
||||||
&pk,
|
pk,
|
||||||
¶ms,
|
params,
|
||||||
&domain,
|
domain,
|
||||||
theta,
|
theta,
|
||||||
&advice.advice_values,
|
&advice.advice_values,
|
||||||
&pk.fixed_values,
|
&pk.fixed_values,
|
||||||
&instance.instance_values,
|
instance.instance_values,
|
||||||
&advice.advice_cosets,
|
&advice.advice_cosets,
|
||||||
&pk.fixed_cosets,
|
&pk.fixed_cosets,
|
||||||
&instance.instance_cosets,
|
&instance.instance_cosets,
|
||||||
|
@ -316,7 +316,7 @@ pub fn create_proof<
|
||||||
pkey,
|
pkey,
|
||||||
&advice.advice_values,
|
&advice.advice_values,
|
||||||
&pk.fixed_values,
|
&pk.fixed_values,
|
||||||
&instance.instance_values,
|
instance.instance_values,
|
||||||
beta,
|
beta,
|
||||||
gamma,
|
gamma,
|
||||||
transcript,
|
transcript,
|
||||||
|
@ -332,7 +332,7 @@ pub fn create_proof<
|
||||||
// Construct and commit to products for each lookup
|
// Construct and commit to products for each lookup
|
||||||
lookups
|
lookups
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|lookup| lookup.commit_product(&pk, ¶ms, theta, beta, gamma, transcript))
|
.map(|lookup| lookup.commit_product(pk, params, theta, beta, gamma, transcript))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
|
@ -51,7 +51,7 @@ impl<C: CurveAffine> Argument<C> {
|
||||||
let h_commitments_projective: Vec<_> = h_pieces
|
let h_commitments_projective: Vec<_> = h_pieces
|
||||||
.iter()
|
.iter()
|
||||||
.zip(h_blinds.iter())
|
.zip(h_blinds.iter())
|
||||||
.map(|(h_piece, blind)| params.commit(&h_piece, *blind))
|
.map(|(h_piece, blind)| params.commit(h_piece, *blind))
|
||||||
.collect();
|
.collect();
|
||||||
let mut h_commitments = vec![C::identity(); h_commitments_projective.len()];
|
let mut h_commitments = vec![C::identity(); h_commitments_projective.len()];
|
||||||
C::Curve::batch_normalize(&h_commitments_projective, &mut h_commitments);
|
C::Curve::batch_normalize(&h_commitments_projective, &mut h_commitments);
|
||||||
|
|
|
@ -187,9 +187,9 @@ pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRea
|
||||||
p.expressions(
|
p.expressions(
|
||||||
vk,
|
vk,
|
||||||
argument,
|
argument,
|
||||||
&advice_evals,
|
advice_evals,
|
||||||
&fixed_evals_copy,
|
&fixed_evals_copy,
|
||||||
&instance_evals,
|
instance_evals,
|
||||||
l_0,
|
l_0,
|
||||||
beta,
|
beta,
|
||||||
gamma,
|
gamma,
|
||||||
|
@ -209,9 +209,9 @@ pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRea
|
||||||
theta,
|
theta,
|
||||||
beta,
|
beta,
|
||||||
gamma,
|
gamma,
|
||||||
&advice_evals,
|
advice_evals,
|
||||||
&fixed_evals_copy_copy,
|
&fixed_evals_copy_copy,
|
||||||
&instance_evals,
|
instance_evals,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.into_iter(),
|
.into_iter(),
|
||||||
|
|
|
@ -39,7 +39,7 @@ impl<'a, C: CurveAffine> MSM<'a, C> {
|
||||||
self.other_bases.extend(other.other_bases.iter());
|
self.other_bases.extend(other.other_bases.iter());
|
||||||
|
|
||||||
if let Some(g_scalars) = &other.g_scalars {
|
if let Some(g_scalars) = &other.g_scalars {
|
||||||
self.add_to_g_scalars(&g_scalars);
|
self.add_to_g_scalars(g_scalars);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(h_scalar) = &other.h_scalar {
|
if let Some(h_scalar) = &other.h_scalar {
|
||||||
|
|
|
@ -173,7 +173,7 @@ fn compute_s<F: Field>(challenges: &[F], init: F) -> Vec<F> {
|
||||||
{
|
{
|
||||||
let (left, right) = v.split_at_mut(len);
|
let (left, right) = v.split_at_mut(len);
|
||||||
let right = &mut right[0..len];
|
let right = &mut right[0..len];
|
||||||
right.copy_from_slice(&left);
|
right.copy_from_slice(left);
|
||||||
for v in right {
|
for v in right {
|
||||||
*v *= challenge;
|
*v *= challenge;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ where
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
commitment::create_proof(¶ms, transcript, &f_poly, f_blind_try, *x_3)
|
commitment::create_proof(params, transcript, &f_poly, f_blind_try, *x_3)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
|
Loading…
Reference in New Issue