Skip to main content

max / makenotwork

bento: collapse a nested if in runner (clippy, rust 1.95) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-19 01:10 UTC
Commit: b058fc71242ec4e94380ce574293d3af0f3e605d
Parent: 15f1353
1 file changed, +2 insertions, -3 deletions
@@ -93,15 +93,14 @@ pub async fn start_build(
93 93 // Latest-wins: abort any in-flight run for this (app, target).
94 94 {
95 95 let mut active = state.active.lock().await;
96 - if let Some(prev) = active.remove(&key) {
97 - if !prev.is_finished() {
96 + if let Some(prev) = active.remove(&key)
97 + && !prev.is_finished() {
98 98 events::emit(
99 99 &state.events,
100 100 Event::TargetAborted { app: app.clone(), target },
101 101 );
102 102 prev.abort();
103 103 }
104 - }
105 104 }
106 105
107 106 let handle = tokio::spawn(run_target(state.clone(), build_id, app, version, target));