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

@@ -146,4 +146,4 @@ impl<E: EthSpec> AggregateAndProof<E> {
}
impl<E: EthSpec> SignedRoot for AggregateAndProof<E> {}
impl<'a, E: EthSpec> SignedRoot for AggregateAndProofRef<'a, E> {}
impl<E: EthSpec> SignedRoot for AggregateAndProofRef<'_, E> {}

View File

@@ -233,7 +233,7 @@ impl<E: EthSpec> Attestation<E> {
}
}
impl<'a, E: EthSpec> AttestationRef<'a, E> {
impl<E: EthSpec> AttestationRef<'_, E> {
pub fn clone_as_attestation(self) -> Attestation<E> {
match self {
Self::Base(att) => Attestation::Base(att.clone()),
@@ -422,7 +422,7 @@ impl<E: EthSpec> SlotData for Attestation<E> {
}
}
impl<'a, E: EthSpec> SlotData for AttestationRef<'a, E> {
impl<E: EthSpec> SlotData for AttestationRef<'_, E> {
fn get_slot(&self) -> Slot {
self.data().slot
}

View File

@@ -80,10 +80,7 @@ pub struct BeaconBlock<E: EthSpec, Payload: AbstractExecPayload<E> = FullPayload
pub type BlindedBeaconBlock<E> = BeaconBlock<E, BlindedPayload<E>>;
impl<E: EthSpec, Payload: AbstractExecPayload<E>> SignedRoot for BeaconBlock<E, Payload> {}
impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> SignedRoot
for BeaconBlockRef<'a, E, Payload>
{
}
impl<E: EthSpec, Payload: AbstractExecPayload<E>> SignedRoot for BeaconBlockRef<'_, E, Payload> {}
/// Empty block trait for each block variant to implement.
pub trait EmptyBlock {

View File

@@ -380,7 +380,7 @@ impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRefMut<'a,
}
}
impl<'a, E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRef<'a, E, Payload> {
impl<E: EthSpec, Payload: AbstractExecPayload<E>> BeaconBlockBodyRef<'_, E, Payload> {
/// Get the fork_name of this object
pub fn fork_name(self) -> ForkName {
match self {

View File

@@ -7,7 +7,7 @@ pub struct BeaconCommittee<'a> {
pub committee: &'a [usize],
}
impl<'a> BeaconCommittee<'a> {
impl BeaconCommittee<'_> {
pub fn into_owned(self) -> OwnedBeaconCommittee {
OwnedBeaconCommittee {
slot: self.slot,

View File

@@ -27,7 +27,7 @@ impl<'a, E: EthSpec> BlockRootsIter<'a, E> {
}
}
impl<'a, E: EthSpec> Iterator for BlockRootsIter<'a, E> {
impl<E: EthSpec> Iterator for BlockRootsIter<'_, E> {
type Item = Result<(Slot, Hash256), Error>;
fn next(&mut self) -> Option<Self::Item> {

View File

@@ -371,7 +371,7 @@ impl<E: EthSpec> TryFrom<ExecutionPayloadHeader<E>> for ExecutionPayloadHeaderDe
}
}
impl<'a, E: EthSpec> ExecutionPayloadHeaderRefMut<'a, E> {
impl<E: EthSpec> ExecutionPayloadHeaderRefMut<'_, E> {
/// Mutate through
pub fn replace(self, header: ExecutionPayloadHeader<E>) -> Result<(), BeaconStateError> {
match self {

View File

@@ -134,7 +134,7 @@ impl<E: EthSpec> IndexedAttestation<E> {
}
}
impl<'a, E: EthSpec> IndexedAttestationRef<'a, E> {
impl<E: EthSpec> IndexedAttestationRef<'_, E> {
pub fn is_double_vote(&self, other: Self) -> bool {
self.data().target.epoch == other.data().target.epoch && self.data() != other.data()
}

View File

@@ -179,12 +179,12 @@ impl<E: EthSpec> LightClientHeaderCapella<E> {
.to_ref()
.block_body_merkle_proof(EXECUTION_PAYLOAD_INDEX)?;
return Ok(LightClientHeaderCapella {
Ok(LightClientHeaderCapella {
beacon: block.message().block_header(),
execution: header,
execution_branch: FixedVector::new(execution_branch)?,
_phantom_data: PhantomData,
});
})
}
}

View File

@@ -418,7 +418,7 @@ impl<E: EthSpec> LightClientUpdate<E> {
return Ok(new_attested_header_slot < prev_attested_header_slot);
}
return Ok(new.signature_slot() < self.signature_slot());
Ok(new.signature_slot() < self.signature_slot())
}
fn is_next_sync_committee_branch_empty<'a>(&'a self) -> bool {

View File

@@ -317,7 +317,7 @@ impl<'a, E: EthSpec> FullPayloadRef<'a, E> {
}
}
impl<'b, E: EthSpec> ExecPayload<E> for FullPayloadRef<'b, E> {
impl<E: EthSpec> ExecPayload<E> for FullPayloadRef<'_, E> {
fn block_type() -> BlockType {
BlockType::Full
}

View File

@@ -133,7 +133,7 @@ pub struct SlotIter<'a> {
slots_per_epoch: u64,
}
impl<'a> Iterator for SlotIter<'a> {
impl Iterator for SlotIter<'_> {
type Item = Slot;
fn next(&mut self) -> Option<Slot> {