Enable clippy's useless_let_if_seq linter (#7220)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
Justin Traglia
2024-03-19 11:33:22 -05:00
committed by GitHub
parent 1bf5d6a53a
commit 709d8a16d3
12 changed files with 56 additions and 44 deletions

View File

@ -96,15 +96,16 @@ impl<DB: Database> Segment<DB> for Headers {
// Generate list of hashes for filters & PHF
let mut cursor = provider.tx_ref().cursor_read::<RawTable<tables::CanonicalHeaders>>()?;
let mut hashes = None;
if config.filters.has_filters() {
hashes = Some(
let hashes = if config.filters.has_filters() {
Some(
cursor
.walk(Some(RawKey::from(*block_range.start())))?
.take(range_len)
.map(|row| row.map(|(_key, value)| value.into_value()).map_err(|e| e.into())),
);
}
)
} else {
None
};
create_static_file_T1_T2_T3::<
tables::Headers,

View File

@ -81,15 +81,16 @@ impl<DB: Database> Segment<DB> for Receipts {
)?;
// Generate list of hashes for filters & PHF
let mut hashes = None;
if config.filters.has_filters() {
hashes = Some(
let hashes = if config.filters.has_filters() {
Some(
provider
.transaction_hashes_by_range(*tx_range.start()..(*tx_range.end() + 1))?
.into_iter()
.map(|(tx, _)| Ok(tx)),
);
}
)
} else {
None
};
create_static_file_T1::<tables::Receipts, TxNumber, SegmentHeader>(
provider.tx_ref(),

View File

@ -85,15 +85,16 @@ impl<DB: Database> Segment<DB> for Transactions {
)?;
// Generate list of hashes for filters & PHF
let mut hashes = None;
if config.filters.has_filters() {
hashes = Some(
let hashes = if config.filters.has_filters() {
Some(
provider
.transaction_hashes_by_range(*tx_range.start()..(*tx_range.end() + 1))?
.into_iter()
.map(|(tx, _)| Ok(tx)),
);
}
)
} else {
None
};
create_static_file_T1::<tables::Transactions, TxNumber, SegmentHeader>(
provider.tx_ref(),