mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 14:58:31 +00:00
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:
@@ -320,7 +320,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
)
|
||||
.into_values()
|
||||
.collect::<Vec<IdealAttestationRewards>>();
|
||||
ideal_rewards.sort_by(|a, b| a.effective_balance.cmp(&b.effective_balance));
|
||||
ideal_rewards.sort_by_key(|a| a.effective_balance);
|
||||
|
||||
Ok(StandardAttestationRewards {
|
||||
ideal_rewards,
|
||||
|
||||
@@ -3694,11 +3694,8 @@ pub fn generate_rand_block_and_blobs<E: EthSpec>(
|
||||
blobs,
|
||||
} = bundle;
|
||||
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user