Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Sep 20, 2024
1 parent 4f1de2d commit eb37ed0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions crates/uplc/src/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,7 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p1: {}", err))
})?;

Err(de::Error::Message(format!(
"BLS12-381 G1 points are not supported for flat decoding."
)))
Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
}

[10] => {
Expand All @@ -688,9 +686,7 @@ impl<'b> Decode<'b> for Constant {
de::Error::Message(format!("Failed to uncompress p2: {}", err))
})?;

Err(de::Error::Message(format!(
"BLS12-381 G2 points are not supported for flat decoding."
)))
Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
}
[11] => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(),
Expand Down Expand Up @@ -740,19 +736,15 @@ fn decode_constant_value(typ: Rc<Type>, d: &mut Decoder) -> Result<Constant, de:
let _p1 = blst::blst_p1::uncompress(&p1)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p1: {}", err)))?;

Err(de::Error::Message(format!(
"BLS12-381 G1 points are not supported for flat decoding."
)))
Err(de::Error::Message("BLS12-381 G1 points are not supported for flat decoding.".to_string()))
}
Type::Bls12_381G2Element => {
let p2 = Vec::<u8>::decode(d)?;

let _p2 = blst::blst_p2::uncompress(&p2)
.map_err(|err| de::Error::Message(format!("Failed to uncompress p2: {}", err)))?;

Err(de::Error::Message(format!(
"BLS12-381 G2 points are not supported for flat decoding."
)))
Err(de::Error::Message("BLS12-381 G2 points are not supported for flat decoding.".to_string()))
}
Type::Bls12_381MlResult => Err(de::Error::Message(
"BLS12-381 ML results are not supported for flat decoding".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions crates/uplc/src/optimize/shrinker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ impl Program<Name> {
{
*term = Term::var(format!("blst_p1_index_{}", index));
} 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));
}
}
Expand All @@ -1163,7 +1163,7 @@ impl Program<Name> {
{
*term = Term::var(format!("blst_p2_index_{}", index));
} 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));
}
}
Expand Down

0 comments on commit eb37ed0

Please sign in to comment.