From d4b0071d1ac26027e320c6d5ee85965a5eb2d413 Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 15 Sep 2026 17:34:59 -0400 Subject: [PATCH] tui: fix clippy unnecessary_unwrap in NO_COLOR cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The alert_line_prefixes_when_no_color test stashed the prior NO_COLOR value and restored it with is_none() + unwrap() — a clippy lint failure under -D warnings. Replace with a match that takes ownership. No behavior change; the restored env var is identical. Co-authored-by: openhands --- tests/tui_spec.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/tui_spec.rs b/tests/tui_spec.rs index 2cec5c3..549b63b 100644 --- a/tests/tui_spec.rs +++ b/tests/tui_spec.rs @@ -884,10 +884,9 @@ fn alert_line_prefixes_when_no_color() { let line = alert_line("peer down", 80); assert!(line.starts_with("! "), "expected '! ' prefix in None mode: {line:?}"); unsafe { - if _guard.is_none() { - std::env::remove_var("NO_COLOR"); - } else { - std::env::set_var("NO_COLOR", _guard.unwrap()); + match _guard { + Some(v) => std::env::set_var("NO_COLOR", v), + None => std::env::remove_var("NO_COLOR"), } }; }