diff --git a/polkadot/node/core/approval-voting/src/lib.rs b/polkadot/node/core/approval-voting/src/lib.rs index cfebd1065edc346982d121f4923556bdf8932945..bc63549795c2c42f63d05f2a79d8bc0c88980377 100644 --- a/polkadot/node/core/approval-voting/src/lib.rs +++ b/polkadot/node/core/approval-voting/src/lib.rs @@ -1144,7 +1144,7 @@ async fn handle_from_overseer<Context>( FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => { let mut actions = Vec::new(); - for activated in update.activated { + if let Some(activated) = update.activated { let head = activated.hash; match import::handle_new_head(ctx, state, db, head, &*last_finalized_height).await { Err(e) => return Err(SubsystemError::with_origin("db", e)), diff --git a/polkadot/node/core/bitfield-signing/src/lib.rs b/polkadot/node/core/bitfield-signing/src/lib.rs index 13a3dd28705f2f48f73bfb698d705a95e11596ed..64cbb18cc44ce964023937566212bdb984e324ca 100644 --- a/polkadot/node/core/bitfield-signing/src/lib.rs +++ b/polkadot/node/core/bitfield-signing/src/lib.rs @@ -225,7 +225,7 @@ async fn run<Context>( } } - for leaf in update.activated { + if let Some(leaf) = update.activated { let sender = ctx.sender().clone(); let leaf_hash = leaf.hash; diff --git a/polkadot/node/core/chain-selection/src/lib.rs b/polkadot/node/core/chain-selection/src/lib.rs index eb5ceac9b7686b93e01104ab2124c8bc98dcb4ee..e5ffe6811d6e7e5bef8c61f8806248a7ac305f45 100644 --- a/polkadot/node/core/chain-selection/src/lib.rs +++ b/polkadot/node/core/chain-selection/src/lib.rs @@ -430,7 +430,7 @@ where return Ok(()) } FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => { - for leaf in update.activated { + if let Some(leaf) = update.activated { let write_ops = handle_active_leaf( ctx.sender(), &*backend, diff --git a/polkadot/node/core/provisioner/src/lib.rs b/polkadot/node/core/provisioner/src/lib.rs index f669f9ddae2cb941f2f71e97b68d48ff6548278e..0530d48aabda400e5afe90211e63bbe8c24183a3 100644 --- a/polkadot/node/core/provisioner/src/lib.rs +++ b/polkadot/node/core/provisioner/src/lib.rs @@ -183,7 +183,7 @@ fn handle_active_leaves_update( per_relay_parent.remove(deactivated); } - for leaf in update.activated { + if let Some(leaf) = update.activated { let delay_fut = Delay::new(PRE_PROPOSE_TIMEOUT).map(move |_| leaf.hash).boxed(); per_relay_parent.insert(leaf.hash, PerRelayParent::new(leaf)); inherent_delays.push(delay_fut); diff --git a/polkadot/node/network/availability-recovery/src/lib.rs b/polkadot/node/network/availability-recovery/src/lib.rs index 4ca28c955f9e63ba3926f740f317b73cd61e1367..5a2905082379af2f20571b9619634375401fbcb5 100644 --- a/polkadot/node/network/availability-recovery/src/lib.rs +++ b/polkadot/node/network/availability-recovery/src/lib.rs @@ -836,7 +836,7 @@ async fn handle_signal(state: &mut State, signal: OverseerSignal) -> SubsystemRe OverseerSignal::Conclude => Ok(true), OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { activated, .. }) => { // if activated is non-empty, set state.live_block to the highest block in `activated` - for activated in activated { + if let Some(activated) = activated { if activated.number > state.live_block.0 { state.live_block = (activated.number, activated.hash) } diff --git a/polkadot/node/network/bitfield-distribution/src/lib.rs b/polkadot/node/network/bitfield-distribution/src/lib.rs index 1b2167484b49c022aacdcf4832916f9b0395f797..2a1e3b8d9ef372550dc0b17e48ec8c7d7cf263ce 100644 --- a/polkadot/node/network/bitfield-distribution/src/lib.rs +++ b/polkadot/node/network/bitfield-distribution/src/lib.rs @@ -233,7 +233,7 @@ impl BitfieldDistribution { })) => { let _timer = self.metrics.time_active_leaves_update(); - for activated in activated { + if let Some(activated) = activated { let relay_parent = activated.hash; gum::trace!(target: LOG_TARGET, ?relay_parent, "activated"); diff --git a/polkadot/node/network/bridge/src/rx/mod.rs b/polkadot/node/network/bridge/src/rx/mod.rs index a08596cd15ac41889d12bb4d03878e1cbe60d521..0cb89b19b0ee099ce41f939f543c2e51e83b863f 100644 --- a/polkadot/node/network/bridge/src/rx/mod.rs +++ b/polkadot/node/network/bridge/src/rx/mod.rs @@ -566,7 +566,7 @@ where num_deactivated = %deactivated.len(), ); - for activated in activated { + if let Some(activated) = activated { let pos = live_heads .binary_search_by(|probe| probe.number.cmp(&activated.number).reverse()) .unwrap_or_else(|i| i); diff --git a/polkadot/node/network/statement-distribution/src/lib.rs b/polkadot/node/network/statement-distribution/src/lib.rs index c0ac09dbe3f80fae3f26ac8be3bfc865fc6a6f3a..055fd4123f9ad587fd6ac1062f3ce6d9f2a23bfb 100644 --- a/polkadot/node/network/statement-distribution/src/lib.rs +++ b/polkadot/node/network/statement-distribution/src/lib.rs @@ -2017,7 +2017,7 @@ impl<R: rand::Rng> StatementDistributionSubsystem<R> { } } - for activated in activated { + if let Some(activated) = activated { let relay_parent = activated.hash; let span = PerLeafSpan::new(activated.span, "statement-distribution"); gum::trace!(