tui: fix clippy unnecessary_unwrap in NO_COLOR cleanup
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:
parent
6ce97a0e3c
commit
d4b0071d1a
1 changed files with 3 additions and 4 deletions
|
|
@ -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());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue