Skip to content

Commit

Permalink
chore(lint): fix clippy::needles_lifetimes (#11496)
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane authored Oct 5, 2024
1 parent 28750e5 commit 36de90f
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions crates/blockchain-tree/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct BundleStateDataRef<'a> {
pub canonical_fork: ForkBlock,
}

impl<'a> ExecutionDataProvider for BundleStateDataRef<'a> {
impl ExecutionDataProvider for BundleStateDataRef<'_> {
fn execution_outcome(&self) -> &ExecutionOutcome {
self.execution_outcome
}
Expand All @@ -33,7 +33,7 @@ impl<'a> ExecutionDataProvider for BundleStateDataRef<'a> {
}
}

impl<'a> BlockExecutionForkProvider for BundleStateDataRef<'a> {
impl BlockExecutionForkProvider for BundleStateDataRef<'_> {
fn canonical_fork(&self) -> ForkBlock {
self.canonical_fork
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ethereum/engine-primitives/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl BuiltPayload for EthBuiltPayload {
}
}

impl<'a> BuiltPayload for &'a EthBuiltPayload {
impl BuiltPayload for &EthBuiltPayload {
fn block(&self) -> &SealedBlock {
(**self).block()
}
Expand Down
8 changes: 4 additions & 4 deletions crates/evm/execution-types/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl Chain {
#[derive(Debug)]
pub struct DisplayBlocksChain<'a>(pub &'a BTreeMap<BlockNumber, SealedBlockWithSenders>);

impl<'a> fmt::Display for DisplayBlocksChain<'a> {
impl fmt::Display for DisplayBlocksChain<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut list = f.debug_list();
let mut values = self.0.values().map(|block| block.num_hash());
Expand All @@ -376,7 +376,7 @@ pub struct ChainBlocks<'a> {
blocks: Cow<'a, BTreeMap<BlockNumber, SealedBlockWithSenders>>,
}

impl<'a> ChainBlocks<'a> {
impl ChainBlocks<'_> {
/// Creates a consuming iterator over all blocks in the chain with increasing block number.
///
/// Note: this always yields at least one block.
Expand Down Expand Up @@ -442,7 +442,7 @@ impl<'a> ChainBlocks<'a> {
}
}

impl<'a> IntoIterator for ChainBlocks<'a> {
impl IntoIterator for ChainBlocks<'_> {
type Item = (BlockNumber, SealedBlockWithSenders);
type IntoIter = std::collections::btree_map::IntoIter<BlockNumber, SealedBlockWithSenders>;

Expand Down Expand Up @@ -571,7 +571,7 @@ pub(super) mod serde_bincode_compat {
}
}

impl<'a> SerializeAs<super::Chain> for Chain<'a> {
impl SerializeAs<super::Chain> for Chain<'_> {
fn serialize_as<S>(source: &super::Chain, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/src/system_calls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ where
.build()
}

impl<'a, EvmConfig, Chainspec, Hook> SystemCaller<'a, EvmConfig, Chainspec, Hook>
impl<EvmConfig, Chainspec, Hook> SystemCaller<'_, EvmConfig, Chainspec, Hook>
where
EvmConfig: ConfigureEvm<Header = Header>,
Chainspec: EthereumHardforks,
Expand Down
2 changes: 1 addition & 1 deletion crates/exex/types/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub(super) mod serde_bincode_compat {
}
}

impl<'a> SerializeAs<super::ExExNotification> for ExExNotification<'a> {
impl SerializeAs<super::ExExNotification> for ExExNotification<'_> {
fn serialize_as<S>(
source: &super::ExExNotification,
serializer: S,
Expand Down
2 changes: 1 addition & 1 deletion crates/net/network/src/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ mod tests {
peers: &'a mut PeersManager,
}

impl<'a> Future for PeerActionFuture<'a> {
impl Future for PeerActionFuture<'_> {
type Output = PeerAction;

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down
2 changes: 1 addition & 1 deletion crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ pub struct RpcContext<'a, Node: FullNodeComponents, EthApi: EthApiTypes> {
pub auth_module: &'a mut AuthRpcModule,
}

impl<'a, Node, EthApi> RpcContext<'a, Node, EthApi>
impl<Node, EthApi> RpcContext<'_, Node, EthApi>
where
Node: FullNodeComponents,
EthApi: EthApiTypes,
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/payload/src/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl BuiltPayload for OptimismBuiltPayload {
}
}

impl<'a> BuiltPayload for &'a OptimismBuiltPayload {
impl BuiltPayload for &OptimismBuiltPayload {
fn block(&self) -> &SealedBlock {
(**self).block()
}
Expand Down
4 changes: 2 additions & 2 deletions crates/payload/builder/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct CachedReadsDbMut<'a, DB> {
pub db: DB,
}

impl<'a, DB: DatabaseRef> Database for CachedReadsDbMut<'a, DB> {
impl<DB: DatabaseRef> Database for CachedReadsDbMut<'_, DB> {
type Error = <DB as DatabaseRef>::Error;

fn basic(&mut self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
Expand Down Expand Up @@ -130,7 +130,7 @@ pub struct CachedReadsDBRef<'a, DB> {
pub inner: RefCell<CachedReadsDbMut<'a, DB>>,
}

impl<'a, DB: DatabaseRef> DatabaseRef for CachedReadsDBRef<'a, DB> {
impl<DB: DatabaseRef> DatabaseRef for CachedReadsDBRef<'_, DB> {
type Error = <DB as DatabaseRef>::Error;

fn basic_ref(&self, address: Address) -> Result<Option<AccountInfo>, Self::Error> {
Expand Down
2 changes: 1 addition & 1 deletion crates/prune/prune/src/segments/static_file/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ where
}
}

impl<'a, Provider> Iterator for HeaderTablesIter<'a, Provider>
impl<Provider> Iterator for HeaderTablesIter<'_, Provider>
where
Provider: DBProvider<Tx: DbTxMut>,
{
Expand Down
16 changes: 8 additions & 8 deletions crates/rpc/rpc-eth-types/src/cache/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub type StateCacheDb<'a> = CacheDB<StateProviderDatabase<StateProviderTraitObjW
#[allow(missing_debug_implementations)]
pub struct StateProviderTraitObjWrapper<'a>(pub &'a dyn StateProvider);

impl<'a> reth_storage_api::StateRootProvider for StateProviderTraitObjWrapper<'a> {
impl reth_storage_api::StateRootProvider for StateProviderTraitObjWrapper<'_> {
fn state_root(
&self,
hashed_state: reth_trie::HashedPostState,
Expand Down Expand Up @@ -50,7 +50,7 @@ impl<'a> reth_storage_api::StateRootProvider for StateProviderTraitObjWrapper<'a
}
}

impl<'a> reth_storage_api::StorageRootProvider for StateProviderTraitObjWrapper<'a> {
impl reth_storage_api::StorageRootProvider for StateProviderTraitObjWrapper<'_> {
fn storage_root(
&self,
address: Address,
Expand All @@ -60,7 +60,7 @@ impl<'a> reth_storage_api::StorageRootProvider for StateProviderTraitObjWrapper<
}
}

impl<'a> reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'a> {
impl reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'_> {
fn proof(
&self,
input: reth_trie::TrieInput,
Expand Down Expand Up @@ -88,7 +88,7 @@ impl<'a> reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'
}
}

impl<'a> reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'a> {
impl reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'_> {
fn basic_account(
&self,
address: revm_primitives::Address,
Expand All @@ -97,7 +97,7 @@ impl<'a> reth_storage_api::AccountReader for StateProviderTraitObjWrapper<'a> {
}
}

impl<'a> reth_storage_api::BlockHashReader for StateProviderTraitObjWrapper<'a> {
impl reth_storage_api::BlockHashReader for StateProviderTraitObjWrapper<'_> {
fn block_hash(
&self,
block_number: alloy_primitives::BlockNumber,
Expand All @@ -121,7 +121,7 @@ impl<'a> reth_storage_api::BlockHashReader for StateProviderTraitObjWrapper<'a>
}
}

impl<'a> StateProvider for StateProviderTraitObjWrapper<'a> {
impl StateProvider for StateProviderTraitObjWrapper<'_> {
fn account_balance(
&self,
addr: revm_primitives::Address,
Expand Down Expand Up @@ -164,7 +164,7 @@ impl<'a> StateProvider for StateProviderTraitObjWrapper<'a> {
#[allow(missing_debug_implementations)]
pub struct StateCacheDbRefMutWrapper<'a, 'b>(pub &'b mut StateCacheDb<'a>);

impl<'a, 'b> Database for StateCacheDbRefMutWrapper<'a, 'b> {
impl<'a> Database for StateCacheDbRefMutWrapper<'a, '_> {
type Error = <StateCacheDb<'a> as Database>::Error;
fn basic(
&mut self,
Expand All @@ -190,7 +190,7 @@ impl<'a, 'b> Database for StateCacheDbRefMutWrapper<'a, 'b> {
}
}

impl<'a, 'b> DatabaseRef for StateCacheDbRefMutWrapper<'a, 'b> {
impl<'a> DatabaseRef for StateCacheDbRefMutWrapper<'a, '_> {
type Error = <StateCacheDb<'a> as Database>::Error;

fn basic_ref(
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-layer/src/auth_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ mod tests {
missing_jwt_error().await;
wrong_jwt_signature_error().await;
invalid_issuance_timestamp_error().await;
jwt_decode_error().await;
jwt_decode_error().await
}

async fn valid_jwt() {
Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-testing-util/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ impl<'a> DebugTraceTransactionsStream<'a> {
}
}

impl<'a> Stream for DebugTraceTransactionsStream<'a> {
impl Stream for DebugTraceTransactionsStream<'_> {
type Item = TraceTransactionResult;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for DebugTraceTransactionsStream<'a> {
impl std::fmt::Debug for DebugTraceTransactionsStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("DebugTraceTransactionsStream").finish_non_exhaustive()
}
Expand All @@ -336,15 +336,15 @@ impl<'a> DebugTraceBlockStream<'a> {
}
}

impl<'a> Stream for DebugTraceBlockStream<'a> {
impl Stream for DebugTraceBlockStream<'_> {
type Item = DebugTraceBlockResult;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for DebugTraceBlockStream<'a> {
impl std::fmt::Debug for DebugTraceBlockStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("DebugTraceBlockStream").finish_non_exhaustive()
}
Expand Down
28 changes: 14 additions & 14 deletions crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ pub struct TraceCallStream<'a> {
stream: Pin<Box<dyn Stream<Item = TraceCallResult> + 'a>>,
}

impl<'a> Stream for TraceCallStream<'a> {
impl Stream for TraceCallStream<'_> {
type Item = TraceCallResult;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for TraceCallStream<'a> {
impl std::fmt::Debug for TraceCallStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TraceCallStream").finish()
}
Expand All @@ -134,7 +134,7 @@ pub struct TraceFilterStream<'a> {
stream: Pin<Box<dyn Stream<Item = TraceFilterResult> + 'a>>,
}

impl<'a> Stream for TraceFilterStream<'a> {
impl Stream for TraceFilterStream<'_> {
type Item = TraceFilterResult;

/// Attempts to pull out the next value of the stream.
Expand All @@ -143,7 +143,7 @@ impl<'a> Stream for TraceFilterStream<'a> {
}
}

impl<'a> std::fmt::Debug for TraceFilterStream<'a> {
impl std::fmt::Debug for TraceFilterStream<'_> {
/// Provides a debug representation of the `TraceFilterStream`.
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TraceFilterStream").finish_non_exhaustive()
Expand All @@ -157,7 +157,7 @@ pub struct TraceGetStream<'a> {
stream: Pin<Box<dyn Stream<Item = TraceGetResult> + 'a>>,
}

impl<'a> Stream for TraceGetStream<'a> {
impl Stream for TraceGetStream<'_> {
type Item = TraceGetResult;

/// Attempts to pull out the next item of the stream
Expand All @@ -166,7 +166,7 @@ impl<'a> Stream for TraceGetStream<'a> {
}
}

impl<'a> std::fmt::Debug for TraceGetStream<'a> {
impl std::fmt::Debug for TraceGetStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TraceGetStream").finish_non_exhaustive()
}
Expand All @@ -180,7 +180,7 @@ pub struct CallManyTraceStream<'a> {
stream: Pin<Box<dyn Stream<Item = CallManyTraceResult> + 'a>>,
}

impl<'a> Stream for CallManyTraceStream<'a> {
impl Stream for CallManyTraceStream<'_> {
type Item = CallManyTraceResult;

/// Polls for the next item from the stream.
Expand All @@ -189,7 +189,7 @@ impl<'a> Stream for CallManyTraceStream<'a> {
}
}

impl<'a> std::fmt::Debug for CallManyTraceStream<'a> {
impl std::fmt::Debug for CallManyTraceStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CallManyTraceStream").finish()
}
Expand All @@ -201,15 +201,15 @@ pub struct RawTransactionTraceStream<'a> {
stream: RawTransactionTraceResult<'a>,
}

impl<'a> Stream for RawTransactionTraceStream<'a> {
impl Stream for RawTransactionTraceStream<'_> {
type Item = Result<(TraceResults, Bytes), (RpcError, Bytes)>;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for RawTransactionTraceStream<'a> {
impl std::fmt::Debug for RawTransactionTraceStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("RawTransactionTraceStream").finish()
}
Expand All @@ -221,15 +221,15 @@ pub struct ReplayTransactionStream<'a> {
stream: Pin<Box<dyn Stream<Item = ReplayTransactionResult> + 'a>>,
}

impl<'a> Stream for ReplayTransactionStream<'a> {
impl Stream for ReplayTransactionStream<'_> {
type Item = ReplayTransactionResult;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for ReplayTransactionStream<'a> {
impl std::fmt::Debug for ReplayTransactionStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ReplayTransactionStream").finish()
}
Expand Down Expand Up @@ -393,15 +393,15 @@ impl<'a> TraceBlockStream<'a> {
}
}

impl<'a> Stream for TraceBlockStream<'a> {
impl Stream for TraceBlockStream<'_> {
type Item = TraceBlockResult;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
self.stream.as_mut().poll_next(cx)
}
}

impl<'a> std::fmt::Debug for TraceBlockStream<'a> {
impl std::fmt::Debug for TraceBlockStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("TraceBlockStream").finish_non_exhaustive()
}
Expand Down
Loading

0 comments on commit 36de90f

Please sign in to comment.