Skip to content

Commit

Permalink
chore: fix "explicit lifetimes could be elided" clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kkovaacs committed Nov 29, 2024
1 parent 88868d1 commit 9871fed
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/crypto/src/algebra/field/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'de> Deserialize<'de> for Felt {
{
struct StarkHashVisitor;

impl<'de> Visitor<'de> for StarkHashVisitor {
impl Visitor<'_> for StarkHashVisitor {
type Value = Felt;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down
1 change: 1 addition & 0 deletions crates/p2p/src/client/peer_agnostic/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ pub trait BlockClient {
declared_classes_count: u64,
) -> impl Future<Output = Result<Option<(PeerId, Vec<ClassDefinition>)>, ClassDefinitionsError>> + Send;

#[allow(clippy::type_complexity)]
fn events_for_block(
self,
block: BlockNumber,
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/src/felt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ mod deserialization {
{
struct FeltVisitor;

impl<'de> serde::de::Visitor<'de> for FeltVisitor {
impl serde::de::Visitor<'_> for FeltVisitor {
type Value = RpcFelt;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down
12 changes: 6 additions & 6 deletions crates/rpc/src/jsonrpc/router/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub async fn handle_json_rpc_body(
/// ```
/// async fn example(RpcContext, impl DeserializeForVersion, RpcVersion) -> Result<Output, Into<RpcError>>
/// ```
impl<'a, F, Input, Output, Error, Fut>
impl<F, Input, Output, Error, Fut>
IntoRpcEndpoint<((), (), Input), ((), (), Output), ((), (), RpcContext)> for F
where
F: Fn(RpcContext, Input, RpcVersion) -> Fut + Sync + Send + 'static,
Expand Down Expand Up @@ -149,7 +149,7 @@ where
/// ```
/// async fn example(RpcContext, impl Deserialize) -> Result<Output, Into<RpcError>>
/// ```
impl<'a, F, Input, Output, Error, Fut> IntoRpcEndpoint<((), Input), ((), Output), ((), RpcContext)>
impl<F, Input, Output, Error, Fut> IntoRpcEndpoint<((), Input), ((), Output), ((), RpcContext)>
for F
where
F: Fn(RpcContext, Input) -> Fut + Sync + Send + 'static,
Expand Down Expand Up @@ -199,7 +199,7 @@ where
/// async fn example(impl Deserialize) -> Result<Output, Into<RpcError>>
/// ```
#[async_trait]
impl<'a, F, Input, Output, Error, Fut> IntoRpcEndpoint<((), Input), ((), Output), ()> for F
impl<F, Input, Output, Error, Fut> IntoRpcEndpoint<((), Input), ((), Output), ()> for F
where
F: Fn(Input) -> Fut + Sync + Send + 'static,
Input: DeserializeForVersion + Sync + Send + 'static,
Expand Down Expand Up @@ -248,7 +248,7 @@ where
/// async fn example(RpcContext) -> Result<Output, Into<RpcError>>
/// ```
#[async_trait]
impl<'a, F, Output, Error, Fut> IntoRpcEndpoint<(), ((), Output), ((), RpcContext)> for F
impl<F, Output, Error, Fut> IntoRpcEndpoint<(), ((), Output), ((), RpcContext)> for F
where
F: Fn(RpcContext) -> Fut + Sync + Send + 'static,
Output: SerializeForVersion + Sync + Send + 'static,
Expand Down Expand Up @@ -299,7 +299,7 @@ where
/// async fn example() -> Result<Output, Into<RpcError>>
/// ```
#[async_trait]
impl<'a, F, Output, Error, Fut> IntoRpcEndpoint<(), (), ((), Output)> for F
impl<F, Output, Error, Fut> IntoRpcEndpoint<(), (), ((), Output)> for F
where
F: Fn() -> Fut + Sync + Send + 'static,
Output: SerializeForVersion + Sync + Send + 'static,
Expand Down Expand Up @@ -350,7 +350,7 @@ where
/// fn example() -> &'static str
/// ```
#[async_trait]
impl<'a, F> IntoRpcEndpoint<(), (), ((), (), &'static str)> for F
impl<F> IntoRpcEndpoint<(), (), ((), (), &'static str)> for F
where
F: Fn() -> &'static str + Sync + Send + 'static,
{
Expand Down
10 changes: 5 additions & 5 deletions crates/serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<'de> DeserializeAs<'de, EthereumAddress> for EthereumAddressAsHexStr {
{
struct EthereumAddressVisitor;

impl<'de> Visitor<'de> for EthereumAddressVisitor {
impl Visitor<'_> for EthereumAddressVisitor {
type Value = EthereumAddress;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -121,7 +121,7 @@ impl<'de> DeserializeAs<'de, H256> for H256AsNoLeadingZerosHexStr {
{
struct H256Visitor;

impl<'de> Visitor<'de> for H256Visitor {
impl Visitor<'_> for H256Visitor {
type Value = H256;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -164,7 +164,7 @@ impl<'de> DeserializeAs<'de, GasPrice> for GasPriceAsHexStr {
{
struct GasPriceVisitor;

impl<'de> Visitor<'de> for GasPriceVisitor {
impl Visitor<'_> for GasPriceVisitor {
type Value = GasPrice;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -207,7 +207,7 @@ impl<'de> DeserializeAs<'de, BlockNumber> for StarknetBlockNumberAsHexStr {
{
struct StarknetBlockNumberVisitor;

impl<'de> Visitor<'de> for StarknetBlockNumberVisitor {
impl Visitor<'_> for StarknetBlockNumberVisitor {
type Value = BlockNumber;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down Expand Up @@ -275,7 +275,7 @@ impl<'de> serde::Deserialize<'de> for U64AsHexStr {
{
struct Visitor;

impl<'de> serde::de::Visitor<'de> for Visitor {
impl serde::de::Visitor<'_> for Visitor {
type Value = U64AsHexStr;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type TransactionDataForBlock = (StarknetTransaction, Receipt, Vec<Event>);

type EventsForBlock = (TransactionHash, Vec<Event>);

impl<'inner> Transaction<'inner> {
impl Transaction<'_> {
// The implementations here are intentionally kept as simple wrappers. This lets
// the real implementations be kept in separate files with more reasonable
// LOC counts and easier test oversight.
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ pub trait RowExt {
row_felt_wrapper!(get_receipt_commitment, ReceiptCommitment);
}

impl<'a> RowExt for &rusqlite::Row<'a> {
impl RowExt for &rusqlite::Row<'_> {
fn get_blob<I: RowIndex>(&self, index: I) -> rusqlite::Result<&[u8]> {
self.get_ref(index)?.as_blob().map_err(|e| e.into())
}
Expand Down

0 comments on commit 9871fed

Please sign in to comment.