Clippy fix

This commit is contained in:
microproofs 2024-09-20 13:47:56 -04:00
parent 4f1de2d3b5
commit eb37ed0da5
No known key found for this signature in database
GPG Key ID: 14F93C84DE6AFD17
2 changed files with 6 additions and 14 deletions

View File

@ -676,9 +676,7 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p1: {}", err)) de::Error::Message(format!("Failed to uncompress p1: {}", err))
})?; })?;
Err(de::Error::Message(format!( Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
"BLS12-381 G1 points are not supported for flat decoding."
)))
} }
[10] => { [10] => {
@ -688,9 +686,7 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p2: {}", err)) de::Error::Message(format!("Failed to uncompress p2: {}", err))
})?; })?;
Err(de::Error::Message(format!( Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
"BLS12-381 G2 points are not supported for flat decoding."
)))
} }
[11] => Err(de::Error::Message( [11] => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(), "BLS12-381 ML results are not supported for flat decoding".to_string(),
@ -740,9 +736,7 @@ fn decode_constant_value(typ: Rc<Type>, d: &mut Decoder) -> Result<Constant, de:
let _p1 = blst::blst_p1::uncompress(&p1) let _p1 = blst::blst_p1::uncompress(&p1)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p1: {}", err)))?; .map_err(|err| de::Error::Message(format!("Failed to uncompress p1: {}", err)))?;
Err(de::Error::Message(format!( Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
"BLS12-381 G1 points are not supported for flat decoding."
)))
} }
Type::Bls12_381G2Element => { Type::Bls12_381G2Element => {
let p2 = Vec::<u8>::decode(d)?; let p2 = Vec::<u8>::decode(d)?;
@ -750,9 +744,7 @@ fn decode_constant_value(typ: Rc<Type>, d: &mut Decoder) -> Result<Constant, de:
let _p2 = blst::blst_p2::uncompress(&p2) let _p2 = blst::blst_p2::uncompress(&p2)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p2: {}", err)))?; .map_err(|err| de::Error::Message(format!("Failed to uncompress p2: {}", err)))?;
Err(de::Error::Message(format!( Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
"BLS12-381 G2 points are not supported for flat decoding."
)))
} }
Type::Bls12_381MlResult => Err(de::Error::Message( Type::Bls12_381MlResult => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(), "BLS12-381 ML results are not supported for flat decoding".to_string(),

View File

@ -1152,7 +1152,7 @@ impl Program<Name> {
{ {
*term = Term::var(format!("blst_p1_index_{}", index)); *term = Term::var(format!("blst_p1_index_{}", index));
} else { } else {
blst_p1_list.push(blst_p1.as_ref().clone()); blst_p1_list.push(*blst_p1.as_ref());
*term = Term::var(format!("blst_p1_index_{}", blst_p1_list.len() - 1)); *term = Term::var(format!("blst_p1_index_{}", blst_p1_list.len() - 1));
} }
} }
@ -1163,7 +1163,7 @@ impl Program<Name> {
{ {
*term = Term::var(format!("blst_p2_index_{}", index)); *term = Term::var(format!("blst_p2_index_{}", index));
} else { } else {
blst_p2_list.push(blst_p2.as_ref().clone()); blst_p2_list.push(*blst_p2.as_ref());
*term = Term::var(format!("blst_p2_index_{}", blst_p2_list.len() - 1)); *term = Term::var(format!("blst_p2_index_{}", blst_p2_list.len() - 1));
} }
} }