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
// seems messy and confusing.
.enumerate()
.filter(move |(_, g)| g.queried_selectors().contains(&selector))
.filter(move |(_, g)| g.queried_selectors().contains(selector))
.flat_map(move |(gate_index, gate)| {
at.iter().flat_map(move |selector_row| {
// 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 poly = pk.vk.domain.lagrange_to_coeff(values.clone());
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)
};
@ -604,7 +604,7 @@ fn permute_expression_pair<C: CurveAffine>(
if row == 0 || *input_value != permuted_input_expression[row - 1] {
*table_value = *input_value;
// 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);
*count -= 1;
None

View File

@ -276,13 +276,13 @@ pub fn create_proof<
.iter()
.map(|lookup| {
lookup.commit_permuted(
&pk,
&params,
&domain,
pk,
params,
domain,
theta,
&advice.advice_values,
&pk.fixed_values,
&instance.instance_values,
instance.instance_values,
&advice.advice_cosets,
&pk.fixed_cosets,
&instance.instance_cosets,
@ -316,7 +316,7 @@ pub fn create_proof<
pkey,
&advice.advice_values,
&pk.fixed_values,
&instance.instance_values,
instance.instance_values,
beta,
gamma,
transcript,
@ -332,7 +332,7 @@ pub fn create_proof<
// Construct and commit to products for each lookup
lookups
.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<_>, _>>()?;

View File

@ -51,7 +51,7 @@ impl<C: CurveAffine> Argument<C> {
let h_commitments_projective: Vec<_> = h_pieces
.iter()
.zip(h_blinds.iter())
.map(|(h_piece, blind)| params.commit(&h_piece, *blind))
.map(|(h_piece, blind)| params.commit(h_piece, *blind))
.collect();
let mut h_commitments = vec![C::identity(); h_commitments_projective.len()];
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(
vk,
argument,
&advice_evals,
advice_evals,
&fixed_evals_copy,
&instance_evals,
instance_evals,
l_0,
beta,
gamma,
@ -209,9 +209,9 @@ pub fn verify_proof<'a, C: CurveAffine, E: EncodedChallenge<C>, T: TranscriptRea
theta,
beta,
gamma,
&advice_evals,
advice_evals,
&fixed_evals_copy_copy,
&instance_evals,
instance_evals,
)
})
.into_iter(),

View File

@ -39,7 +39,7 @@ impl<'a, C: CurveAffine> MSM<'a, C> {
self.other_bases.extend(other.other_bases.iter());
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 {

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 right = &mut right[0..len];
right.copy_from_slice(&left);
right.copy_from_slice(left);
for v in right {
*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)]