Fix Rust 1.83 Clippy lints (#6629)

* Fix Rust 1.83 Clippy lints

* Cargo fmt
This commit is contained in:
Michael Sproul
2024-11-29 13:23:54 +11:00
committed by GitHub
parent 38f5f665e1
commit fa6c4c02a3
35 changed files with 73 additions and 77 deletions

View File

@@ -20,7 +20,7 @@ macro_rules! impl_tree_hash {
// but benchmarks have show that to be at least 15% slower because of the
// unnecessary copying and allocation (one Vec per byte)
let values_per_chunk = tree_hash::BYTES_PER_CHUNK;
let minimum_chunk_count = ($byte_size + values_per_chunk - 1) / values_per_chunk;
let minimum_chunk_count = $byte_size.div_ceil(values_per_chunk);
tree_hash::merkle_root(&self.serialize(), minimum_chunk_count)
}
};

View File

@@ -99,7 +99,7 @@ impl<'de> Deserialize<'de> for G1Point {
{
struct G1PointVisitor;
impl<'de> Visitor<'de> for G1PointVisitor {
impl Visitor<'_> for G1PointVisitor {
type Value = G1Point;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("A 48 byte hex encoded string")
@@ -135,7 +135,7 @@ impl<'de> Deserialize<'de> for G2Point {
{
struct G2PointVisitor;
impl<'de> Visitor<'de> for G2PointVisitor {
impl Visitor<'_> for G2PointVisitor {
type Value = G2Point;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("A 96 byte hex encoded string")