From 2c9cd2b3e661ef85f11590c7128dcb2f502d0c26 Mon Sep 17 00:00:00 2001 From: Codex-ytr83r Date: Sat, 12 Sep 2026 23:09:21 -0700 Subject: [PATCH] Simplify Scenario geometry admission conditions for strict lint --- .../src/behavior/scenario_layout.rs | 65 +++++++++---------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/crates/oa-desktop/src/behavior/scenario_layout.rs b/crates/oa-desktop/src/behavior/scenario_layout.rs index b62ba710..e30e94d2 100644 --- a/crates/oa-desktop/src/behavior/scenario_layout.rs +++ b/crates/oa-desktop/src/behavior/scenario_layout.rs @@ -314,17 +314,14 @@ impl Plan { .. }), ) = (messages.get(id), occurrence(p, *id)) - { - if let Some((previous, previous_y)) = + && let Some((previous, previous_y)) = last.insert(*lane, (*id, message.receive_y)) - { - if previous_y > message.receive_y { - return Err(GeometryIssue::LifetimeInversionNotSupported { - create: previous, - delete: *id, - }); - } - } + && previous_y > message.receive_y + { + return Err(GeometryIssue::LifetimeInversionNotSupported { + create: previous, + delete: *id, + }); } } } @@ -453,13 +450,13 @@ impl Plan { after: pair[1], }); } - if let Some(frame) = frames.get(&pair[0]) { - if frame.y + frame.height > b.y { - diagnostics.push(Diagnostic::FrameExtendsPastFollowingAnchor { - frame: pair[0], - following: pair[1], - }); - } + if let Some(frame) = frames.get(&pair[0]) + && frame.y + frame.height > b.y + { + diagnostics.push(Diagnostic::FrameExtendsPastFollowingAnchor { + frame: pair[0], + following: pair[1], + }); } } } @@ -675,15 +672,14 @@ pub(super) fn resolve( reply_to: Some(call), .. }) => { - if let Some(start) = plan.messages.get(call) { - if (desired.contains_key(&id) || desired.contains_key(call)) - && message.send_y <= start.receive_y - { - issues.push(GeometryIssue::TypedActivationCrossingNotSupported { - call: *call, - event: id, - }); - } + if let Some(start) = plan.messages.get(call) + && (desired.contains_key(&id) || desired.contains_key(call)) + && message.send_y <= start.receive_y + { + issues.push(GeometryIssue::TypedActivationCrossingNotSupported { + call: *call, + event: id, + }); } } _ => {} @@ -708,15 +704,14 @@ pub(super) fn resolve( | scenario_activation::Finish::Terminated(event) => Some(event), _ => None, }; - if let Some(event) = event { - if (desired.contains_key(&event) || desired.contains_key(&segment.call)) - && plan.anchors[&event].y <= start.receive_y - { - issues.push(GeometryIssue::TypedActivationCrossingNotSupported { - call: segment.call, - event, - }); - } + if let Some(event) = event + && (desired.contains_key(&event) || desired.contains_key(&segment.call)) + && plan.anchors[&event].y <= start.receive_y + { + issues.push(GeometryIssue::TypedActivationCrossingNotSupported { + call: segment.call, + event, + }); } } if !issues.is_empty() {