From c012a9e442a861b55187c7f607c6bf6a213b4c89 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 15 Oct 2026 15:21:59 -0400 Subject: [PATCH] ui: collapse the Relax-around-worst-element condition (clippy) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo --- crates/ui-egui/src/reply.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/reply.rs b/crates/ui-egui/src/reply.rs index b5bb851..d5f24a4 100644 --- a/crates/ui-egui/src/reply.rs +++ b/crates/ui-egui/src/reply.rs @@ -393,14 +393,13 @@ fn quality(ui: &mut egui::Ui, t: &Tokens, v: &Value, acts: &mut Vec) { acts.push(Act::Elements(l)); } } - if let Some(worst) = v.pointer("/metrics/scaled_jacobian/worst").and_then(Value::as_u64).and_then(|w| u32::try_from(w).ok()) { - if ui + if let Some(worst) = v.pointer("/metrics/scaled_jacobian/worst").and_then(Value::as_u64).and_then(|w| u32::try_from(w).ok()) + && ui .button("Relax around worst element") .on_hover_text("Open Relax Nodes with its sphere round the element of smallest scaled Jacobian; preview, then OK") .clicked() - { - acts.push(Act::Relax(worst)); - } + { + acts.push(Act::Relax(worst)); } for (key, label, low_bad) in METRICS { let Some(m) = v.pointer(&format!("/metrics/{key}")).filter(|m| m.is_object()) else { continue };