style: collapse nested if block

lint message: this `if` statement can be collapsed
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#collapsible_if
This commit is contained in:
Gwen Lg
2025-12-14 12:57:29 +01:00
parent 8772db8228
commit a426b00e87
3 changed files with 21 additions and 13 deletions
+4 -2
View File
@@ -343,14 +343,16 @@ impl RequestHandler for ClusterLayoutSkipDeadNodesRequest {
for node in all_nodes.iter() {
// Update ACK tracker for dead nodes or for all nodes if --allow-missing-data
if self.allow_missing_data || !status.iter().any(|x| x.id == *node && x.is_up) {
if layout.update_trackers.ack_map.set_max(*node, self.version) {
let ack_changed = layout.update_trackers.ack_map.set_max(*node, self.version);
if ack_changed {
ack_updated.push(hex::encode(node));
}
}
// If --allow-missing-data, update SYNC tracker for all nodes.
if self.allow_missing_data {
if layout.update_trackers.sync_map.set_max(*node, self.version) {
let sync_changed = layout.update_trackers.sync_map.set_max(*node, self.version);
if sync_changed {
sync_updated.push(hex::encode(node));
}
}