clippy: Remove unnecessary Result

This commit is contained in:
Jack Grigg 2021-01-14 13:29:19 +00:00 committed by Sean Bowe
parent ec8c925587
commit d95e4e4724
No known key found for this signature in database
GPG key ID: 95684257D8F8B031
3 changed files with 16 additions and 22 deletions

View file

@ -344,13 +344,10 @@ impl<'a, C: CurveAffine> Committed<'a, C> {
theta: ChallengeTheta<C>, theta: ChallengeTheta<C>,
beta: ChallengeBeta<C>, beta: ChallengeBeta<C>,
gamma: ChallengeGamma<C>, gamma: ChallengeGamma<C>,
) -> Result< ) -> (
(
Constructed<C>, Constructed<C>,
impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a, impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a,
), ) {
Error,
> {
let permuted = self.permuted; let permuted = self.permuted;
let expressions = iter::empty() let expressions = iter::empty()
@ -417,7 +414,7 @@ impl<'a, C: CurveAffine> Committed<'a, C> {
* &(permuted.permuted_input_coset.clone() - &permuted.permuted_input_inv_coset), * &(permuted.permuted_input_coset.clone() - &permuted.permuted_input_inv_coset),
)); ));
Ok(( (
Constructed { Constructed {
permuted_input_poly: permuted.permuted_input_poly, permuted_input_poly: permuted.permuted_input_poly,
permuted_input_blind: permuted.permuted_input_blind, permuted_input_blind: permuted.permuted_input_blind,
@ -427,7 +424,7 @@ impl<'a, C: CurveAffine> Committed<'a, C> {
product_blind: self.product_blind, product_blind: self.product_blind,
}, },
expressions, expressions,
)) )
} }
} }

View file

@ -141,13 +141,10 @@ impl<C: CurveAffine> Committed<C> {
advice_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>], advice_cosets: &'a [Polynomial<C::Scalar, ExtendedLagrangeCoeff>],
beta: ChallengeBeta<C>, beta: ChallengeBeta<C>,
gamma: ChallengeGamma<C>, gamma: ChallengeGamma<C>,
) -> Result< ) -> (
(
Constructed<C>, Constructed<C>,
impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a, impl Iterator<Item = Polynomial<C::Scalar, ExtendedLagrangeCoeff>> + 'a,
), ) {
Error,
> {
let domain = &pk.vk.domain; let domain = &pk.vk.domain;
let expressions = iter::empty() let expressions = iter::empty()
@ -197,13 +194,13 @@ impl<C: CurveAffine> Committed<C> {
left - &right left - &right
})); }));
Ok(( (
Constructed { Constructed {
permutation_product_poly: self.permutation_product_poly, permutation_product_poly: self.permutation_product_poly,
permutation_product_blind: self.permutation_product_blind, permutation_product_blind: self.permutation_product_blind,
}, },
expressions, expressions,
)) )
} }
} }

View file

@ -208,24 +208,24 @@ pub fn create_proof<C: CurveAffine, T: TranscriptWrite<C>, ConcreteCircuit: Circ
// Evaluate the h(X) polynomial's constraint system expressions for the permutation constraints, if any. // Evaluate the h(X) polynomial's constraint system expressions for the permutation constraints, if any.
let (permutations, permutation_expressions): (Vec<_>, Vec<_>) = { let (permutations, permutation_expressions): (Vec<_>, Vec<_>) = {
let tmp = permutations let tmp: Vec<_> = permutations
.into_iter() .into_iter()
.zip(pk.vk.cs.permutations.iter()) .zip(pk.vk.cs.permutations.iter())
.zip(pk.permutations.iter()) .zip(pk.permutations.iter())
.map(|((p, argument), pkey)| { .map(|((p, argument), pkey)| {
p.construct(pk, argument, pkey, &advice_cosets, beta, gamma) p.construct(pk, argument, pkey, &advice_cosets, beta, gamma)
}) })
.collect::<Result<Vec<_>, _>>()?; .collect();
tmp.into_iter().unzip() tmp.into_iter().unzip()
}; };
// Evaluate the h(X) polynomial's constraint system expressions for the lookup constraints, if any. // Evaluate the h(X) polynomial's constraint system expressions for the lookup constraints, if any.
let (lookups, lookup_expressions): (Vec<_>, Vec<_>) = { let (lookups, lookup_expressions): (Vec<_>, Vec<_>) = {
let tmp = lookups let tmp: Vec<_> = lookups
.into_iter() .into_iter()
.map(|p| p.construct(pk, theta, beta, gamma)) .map(|p| p.construct(pk, theta, beta, gamma))
.collect::<Result<Vec<_>, _>>()?; .collect();
tmp.into_iter().unzip() tmp.into_iter().unzip()
}; };