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"), } }; }