mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-27 01:33:33 +00:00
Rust 1.89 compiler lint fix (#7644)
Fix lints for Rust 1.89 beta compiler
This commit is contained in:
@@ -353,7 +353,7 @@ impl<T: BeaconChainTypes> Clone for IndexedUnaggregatedAttestation<'_, T> {
|
||||
/// A helper trait implemented on wrapper types that can be progressed to a state where they can be
|
||||
/// verified for application to fork choice.
|
||||
pub trait VerifiedAttestation<T: BeaconChainTypes>: Sized {
|
||||
fn attestation(&self) -> AttestationRef<T::EthSpec>;
|
||||
fn attestation(&self) -> AttestationRef<'_, T::EthSpec>;
|
||||
|
||||
fn indexed_attestation(&self) -> &IndexedAttestation<T::EthSpec>;
|
||||
|
||||
@@ -366,7 +366,7 @@ pub trait VerifiedAttestation<T: BeaconChainTypes>: Sized {
|
||||
}
|
||||
|
||||
impl<T: BeaconChainTypes> VerifiedAttestation<T> for VerifiedAggregatedAttestation<'_, T> {
|
||||
fn attestation(&self) -> AttestationRef<T::EthSpec> {
|
||||
fn attestation(&self) -> AttestationRef<'_, T::EthSpec> {
|
||||
self.attestation()
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ impl<T: BeaconChainTypes> VerifiedAttestation<T> for VerifiedAggregatedAttestati
|
||||
}
|
||||
|
||||
impl<T: BeaconChainTypes> VerifiedAttestation<T> for VerifiedUnaggregatedAttestation<'_, T> {
|
||||
fn attestation(&self) -> AttestationRef<T::EthSpec> {
|
||||
fn attestation(&self) -> AttestationRef<'_, T::EthSpec> {
|
||||
self.attestation.to_ref()
|
||||
}
|
||||
|
||||
|
||||
@@ -7080,7 +7080,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
&self,
|
||||
block_root: Hash256,
|
||||
block_data: AvailableBlockData<T::EthSpec>,
|
||||
) -> Result<Option<StoreOp<T::EthSpec>>, String> {
|
||||
) -> Result<Option<StoreOp<'_, T::EthSpec>>, String> {
|
||||
match block_data {
|
||||
AvailableBlockData::NoData => Ok(None),
|
||||
AvailableBlockData::Blobs(blobs) => {
|
||||
|
||||
@@ -2042,7 +2042,7 @@ pub fn cheap_state_advance_to_obtain_committees<'a, E: EthSpec, Err: BlockBlobEr
|
||||
/// Obtains a read-locked `ValidatorPubkeyCache` from the `chain`.
|
||||
pub fn get_validator_pubkey_cache<T: BeaconChainTypes>(
|
||||
chain: &BeaconChain<T>,
|
||||
) -> Result<RwLockReadGuard<ValidatorPubkeyCache<T>>, BeaconChainError> {
|
||||
) -> Result<RwLockReadGuard<'_, ValidatorPubkeyCache<T>>, BeaconChainError> {
|
||||
Ok(chain.validator_pubkey_cache.read())
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ pub trait AsBlock<E: EthSpec> {
|
||||
fn parent_root(&self) -> Hash256;
|
||||
fn state_root(&self) -> Hash256;
|
||||
fn signed_block_header(&self) -> SignedBeaconBlockHeader;
|
||||
fn message(&self) -> BeaconBlockRef<E>;
|
||||
fn message(&self) -> BeaconBlockRef<'_, E>;
|
||||
fn as_block(&self) -> &SignedBeaconBlock<E>;
|
||||
fn block_cloned(&self) -> Arc<SignedBeaconBlock<E>>;
|
||||
fn canonical_root(&self) -> Hash256;
|
||||
@@ -392,7 +392,7 @@ impl<E: EthSpec> AsBlock<E> for Arc<SignedBeaconBlock<E>> {
|
||||
SignedBeaconBlock::signed_block_header(self)
|
||||
}
|
||||
|
||||
fn message(&self) -> BeaconBlockRef<E> {
|
||||
fn message(&self) -> BeaconBlockRef<'_, E> {
|
||||
SignedBeaconBlock::message(self)
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ impl<E: EthSpec> AsBlock<E> for MaybeAvailableBlock<E> {
|
||||
fn signed_block_header(&self) -> SignedBeaconBlockHeader {
|
||||
self.as_block().signed_block_header()
|
||||
}
|
||||
fn message(&self) -> BeaconBlockRef<E> {
|
||||
fn message(&self) -> BeaconBlockRef<'_, E> {
|
||||
self.as_block().message()
|
||||
}
|
||||
fn as_block(&self) -> &SignedBeaconBlock<E> {
|
||||
@@ -466,7 +466,7 @@ impl<E: EthSpec> AsBlock<E> for AvailableBlock<E> {
|
||||
self.block().signed_block_header()
|
||||
}
|
||||
|
||||
fn message(&self) -> BeaconBlockRef<E> {
|
||||
fn message(&self) -> BeaconBlockRef<'_, E> {
|
||||
self.block().message()
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ impl<E: EthSpec> AsBlock<E> for RpcBlock<E> {
|
||||
fn signed_block_header(&self) -> SignedBeaconBlockHeader {
|
||||
self.as_block().signed_block_header()
|
||||
}
|
||||
fn message(&self) -> BeaconBlockRef<E> {
|
||||
fn message(&self) -> BeaconBlockRef<'_, E> {
|
||||
self.as_block().message()
|
||||
}
|
||||
fn as_block(&self) -> &SignedBeaconBlock<E> {
|
||||
|
||||
@@ -73,11 +73,11 @@ impl<T> CanonicalHeadRwLock<T> {
|
||||
Self::from(RwLock::new(item))
|
||||
}
|
||||
|
||||
fn read(&self) -> RwLockReadGuard<T> {
|
||||
fn read(&self) -> RwLockReadGuard<'_, T> {
|
||||
self.0.read()
|
||||
}
|
||||
|
||||
fn write(&self) -> RwLockWriteGuard<T> {
|
||||
fn write(&self) -> RwLockWriteGuard<'_, T> {
|
||||
self.0.write()
|
||||
}
|
||||
}
|
||||
@@ -369,7 +369,7 @@ impl<T: BeaconChainTypes> CanonicalHead<T> {
|
||||
///
|
||||
/// This function is **not safe** to be public. See the module-level documentation for more
|
||||
/// information about protecting from deadlocks.
|
||||
fn cached_head_read_lock(&self) -> RwLockReadGuard<CachedHead<T::EthSpec>> {
|
||||
fn cached_head_read_lock(&self) -> RwLockReadGuard<'_, CachedHead<T::EthSpec>> {
|
||||
self.cached_head.read()
|
||||
}
|
||||
|
||||
@@ -377,18 +377,18 @@ impl<T: BeaconChainTypes> CanonicalHead<T> {
|
||||
///
|
||||
/// This function is **not safe** to be public. See the module-level documentation for more
|
||||
/// information about protecting from deadlocks.
|
||||
fn cached_head_write_lock(&self) -> RwLockWriteGuard<CachedHead<T::EthSpec>> {
|
||||
fn cached_head_write_lock(&self) -> RwLockWriteGuard<'_, CachedHead<T::EthSpec>> {
|
||||
self.cached_head.write()
|
||||
}
|
||||
|
||||
/// Access a read-lock for fork choice.
|
||||
pub fn fork_choice_read_lock(&self) -> RwLockReadGuard<BeaconForkChoice<T>> {
|
||||
pub fn fork_choice_read_lock(&self) -> RwLockReadGuard<'_, BeaconForkChoice<T>> {
|
||||
let _timer = metrics::start_timer(&metrics::FORK_CHOICE_READ_LOCK_AQUIRE_TIMES);
|
||||
self.fork_choice.read()
|
||||
}
|
||||
|
||||
/// Access a write-lock for fork choice.
|
||||
pub fn fork_choice_write_lock(&self) -> RwLockWriteGuard<BeaconForkChoice<T>> {
|
||||
pub fn fork_choice_write_lock(&self) -> RwLockWriteGuard<'_, BeaconForkChoice<T>> {
|
||||
let _timer = metrics::start_timer(&metrics::FORK_CHOICE_WRITE_LOCK_AQUIRE_TIMES);
|
||||
self.fork_choice.write()
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ fn ssz_blob_to_crypto_blob_boxed<E: EthSpec>(blob: &Blob<E>) -> Result<Box<KzgBl
|
||||
|
||||
/// Converts a cell ssz List object to an array to be used with the kzg
|
||||
/// crypto library.
|
||||
fn ssz_cell_to_crypto_cell<E: EthSpec>(cell: &Cell<E>) -> Result<KzgCellRef, KzgError> {
|
||||
fn ssz_cell_to_crypto_cell<E: EthSpec>(cell: &Cell<E>) -> Result<KzgCellRef<'_>, KzgError> {
|
||||
let cell_bytes: &[u8] = cell.as_ref();
|
||||
Ok(cell_bytes
|
||||
.try_into()
|
||||
|
||||
Reference in New Issue
Block a user