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:
Daira Hopwood 2021-06-21 18:19:15 +01:00
parent ffe87e1fef
commit 209144981a
8 changed files with 17 additions and 17 deletions

View File

@ -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.

View File

@ -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

View File

@ -276,13 +276,13 @@ pub fn create_proof<
.iter() .iter()
.map(|lookup| { .map(|lookup| {
lookup.commit_permuted( lookup.commit_permuted(
&pk, pk,
&params, 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, &params, 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<_>, _>>()?;

View File

@ -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);

View File

@ -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(),

View File

@ -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 {

View File

@ -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;
} }

View File

@ -114,7 +114,7 @@ where
}, },
); );
commitment::create_proof(&params, transcript, &f_poly, f_blind_try, *x_3) commitment::create_proof(params, transcript, &f_poly, f_blind_try, *x_3)
} }
#[doc(hidden)] #[doc(hidden)]