mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
clippy: add if_not_else clippy lint (#10524)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -652,13 +652,7 @@ where
|
||||
return Ok(TreeOutcome::new(status))
|
||||
}
|
||||
|
||||
let status = if !self.backfill_sync_state.is_idle() {
|
||||
if let Err(error) = self.buffer_block_without_senders(block) {
|
||||
self.on_insert_block_error(error)?
|
||||
} else {
|
||||
PayloadStatus::from_status(PayloadStatusEnum::Syncing)
|
||||
}
|
||||
} else {
|
||||
let status = if self.backfill_sync_state.is_idle() {
|
||||
let mut latest_valid_hash = None;
|
||||
let num_hash = block.num_hash();
|
||||
match self.insert_block_without_senders(block) {
|
||||
@@ -684,6 +678,10 @@ where
|
||||
}
|
||||
Err(error) => self.on_insert_block_error(error)?,
|
||||
}
|
||||
} else if let Err(error) = self.buffer_block_without_senders(block) {
|
||||
self.on_insert_block_error(error)?
|
||||
} else {
|
||||
PayloadStatus::from_status(PayloadStatusEnum::Syncing)
|
||||
};
|
||||
|
||||
let mut outcome = TreeOutcome::new(status);
|
||||
@@ -862,12 +860,12 @@ where
|
||||
fn advance_persistence(&mut self) -> Result<(), TryRecvError> {
|
||||
if self.should_persist() && !self.persistence_state.in_progress() {
|
||||
let blocks_to_persist = self.get_canonical_blocks_to_persist();
|
||||
if !blocks_to_persist.is_empty() {
|
||||
if blocks_to_persist.is_empty() {
|
||||
debug!(target: "engine", "Returned empty set of blocks to persist");
|
||||
} else {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
let _ = self.persistence.save_blocks(blocks_to_persist, tx);
|
||||
self.persistence_state.start(rx);
|
||||
} else {
|
||||
debug!(target: "engine", "Returned empty set of blocks to persist");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user