Rust 1.95 lints (#9142)

N/A


  Adds lints for rust 1.95. Mostly cosmetic.
1. .zip(a.into_iter()) -> .zip(a) . Also a few more places where into_iter is not required
2. replace sort_by with sort_by_key
3. move if statements inside match block.
4. use checked_div instead of if statements. I think this is debatable in terms of being better, happy to remove it if others also feel its unnecessary


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
Pawan Dhananjay
2026-04-17 05:20:20 +05:30
committed by GitHub
parent 794718e96b
commit 4cb3ffed8d
15 changed files with 142 additions and 176 deletions

View File

@@ -1789,7 +1789,7 @@ impl<'de> Deserialize<'de> for BlobSchedule {
impl BlobSchedule {
pub fn new(mut vec: Vec<BlobParameters>) -> Self {
// reverse sort by epoch
vec.sort_by(|a, b| b.epoch.cmp(&a.epoch));
vec.sort_by_key(|b| std::cmp::Reverse(b.epoch));
Self {
schedule: vec,
skip_serializing: false,

View File

@@ -34,11 +34,8 @@ pub fn generate_rand_block_and_blobs<E: EthSpec>(
.blob_kzg_commitments_mut()
.expect("kzg commitment expected from Deneb") = commitments.clone();
for (index, ((blob, kzg_commitment), kzg_proof)) in blobs
.into_iter()
.zip(commitments.into_iter())
.zip(proofs.into_iter())
.enumerate()
for (index, ((blob, kzg_commitment), kzg_proof)) in
blobs.into_iter().zip(commitments).zip(proofs).enumerate()
{
blob_sidecars.push(BlobSidecar {
index: index as u64,