chore: make clippy happy (#13561)

This commit is contained in:
Federico Gimenez
2024-12-27 10:38:41 +01:00
committed by GitHub
parent 56ce046317
commit df294e424b
17 changed files with 38 additions and 72 deletions

View File

@ -917,14 +917,7 @@ impl<N: ProviderNodeTypes> TransactionsProvider for ConsistentProvider<N> {
id.into(),
|provider| provider.transaction_by_id(id),
|tx_index, _, block_state| {
Ok(block_state
.block_ref()
.block()
.body
.transactions()
.get(tx_index)
.cloned()
.map(Into::into))
Ok(block_state.block_ref().block().body.transactions().get(tx_index).cloned())
},
)
}
@ -937,14 +930,7 @@ impl<N: ProviderNodeTypes> TransactionsProvider for ConsistentProvider<N> {
id.into(),
|provider| provider.transaction_by_id_unhashed(id),
|tx_index, _, block_state| {
Ok(block_state
.block_ref()
.block()
.body
.transactions()
.get(tx_index)
.cloned()
.map(Into::into))
Ok(block_state.block_ref().block().body.transactions().get(tx_index).cloned())
},
)
}

View File

@ -1042,9 +1042,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> HeaderProvider for DatabasePro
StaticFileSegment::Headers,
to_range(range),
|static_file, range, _| static_file.headers_range(range),
|range, _| {
self.cursor_read_collect::<tables::Headers<Self::Header>>(range).map_err(Into::into)
},
|range, _| self.cursor_read_collect::<tables::Headers<Self::Header>>(range),
|_| true,
)
}
@ -1120,9 +1118,7 @@ impl<TX: DbTx + 'static, N: NodeTypes> BlockHashReader for DatabaseProvider<TX,
StaticFileSegment::Headers,
start..end,
|static_file, range, _| static_file.canonical_hashes_range(range.start, range.end),
|range, _| {
self.cursor_read_collect::<tables::CanonicalHeaders>(range).map_err(Into::into)
},
|range, _| self.cursor_read_collect::<tables::CanonicalHeaders>(range),
|_| true,
)
}
@ -1517,7 +1513,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> TransactionsProvider for Datab
&self,
range: impl RangeBounds<TxNumber>,
) -> ProviderResult<Vec<Address>> {
self.cursor_read_collect::<tables::TransactionSenders>(range).map_err(Into::into)
self.cursor_read_collect::<tables::TransactionSenders>(range)
}
fn transaction_sender(&self, id: TxNumber) -> ProviderResult<Option<Address>> {
@ -1570,10 +1566,7 @@ impl<TX: DbTx + 'static, N: NodeTypesForProvider> ReceiptProvider for DatabasePr
StaticFileSegment::Receipts,
to_range(range),
|static_file, range, _| static_file.receipts_by_tx_range(range),
|range, _| {
self.cursor_read_collect::<tables::Receipts<Self::Receipt>>(range)
.map_err(Into::into)
},
|range, _| self.cursor_read_collect::<tables::Receipts<Self::Receipt>>(range),
|_| true,
)
}