tui: fix clippy unnecessary_unwrap in NO_COLOR cleanup
All checks were successful
ci / test (pull_request) Successful in 3m58s
ci / sdk (pull_request) Successful in 56s
android-ci / android (pull_request) Successful in 8m16s

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 <[email protected]>
This commit is contained in:
agent 2026-09-15 17:34:59 -04:00
commit d4b0071d1a
No known key found for this signature in database

View file

@ -884,10 +884,9 @@ fn alert_line_prefixes_when_no_color() {
let line = alert_line("peer down", 80); let line = alert_line("peer down", 80);
assert!(line.starts_with("! "), "expected '! ' prefix in None mode: {line:?}"); assert!(line.starts_with("! "), "expected '! ' prefix in None mode: {line:?}");
unsafe { unsafe {
if _guard.is_none() { match _guard {
std::env::remove_var("NO_COLOR"); Some(v) => std::env::set_var("NO_COLOR", v),
} else { None => std::env::remove_var("NO_COLOR"),
std::env::set_var("NO_COLOR", _guard.unwrap());
} }
}; };
} }