tui: extract pub ColorMode/TokenStyles/tokens_for for testable colour tokens #80

Merged
sirius merged 3 commits from wt/t_49b7c2b1 into main 2026-09-15 21:51:16 +00:00
Showing only changes of commit d4b0071d1a - Show all commits

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]>
agent 2026-09-15 17:34:59 -04:00
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);
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"),
}
};
}