clippy: add redundant_else clippy lint (#10525)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2024-08-26 02:40:10 -07:00
committed by GitHub
parent 73a424205d
commit 9c57c4a454
12 changed files with 37 additions and 51 deletions

View File

@ -599,10 +599,9 @@ impl Future for ActiveSession {
Poll::Ready(None) => {
if this.is_disconnecting() {
break
} else {
debug!(target: "net::session", remote_peer_id=?this.remote_peer_id, "eth stream completed");
return this.emit_disconnect(cx)
}
debug!(target: "net::session", remote_peer_id=?this.remote_peer_id, "eth stream completed");
return this.emit_disconnect(cx)
}
Poll::Ready(Some(res)) => {
match res {

View File

@ -275,9 +275,8 @@ impl TransactionFetcher {
// tx is really big, pack request with single tx
if size >= self.info.soft_limit_byte_size_pooled_transactions_response_on_pack_request {
return hashes_from_announcement_iter.collect::<RequestTxHashes>()
} else {
acc_size_response = size;
}
acc_size_response = size;
}
let mut surplus_hashes = RequestTxHashes::with_capacity(hashes_from_announcement_len - 1);
@ -692,14 +691,9 @@ impl TransactionFetcher {
Some(new_announced_hashes)
}
}
} else {
// stores a new request future for the request
self.inflight_requests.push(GetPooledTxRequestFut::new(
peer_id,
new_announced_hashes,
rx,
))
}
// stores a new request future for the request
self.inflight_requests.push(GetPooledTxRequestFut::new(peer_id, new_announced_hashes, rx));
None
}