Rewrite boolean condition

This commit is contained in:
David Peter authored and David Peter committed 2022-09-07 08:44:57 +02:00
1 parent 049d1138c9
commit 9fefe9af31
1 file changed
+6 -6
+6 -6
View File
@@ -298,12 +298,12 @@ impl Options {
|| !atty::is(Stream::Stdout) || !atty::is(Stream::Stdout)
{ {
OutputStyleOption::Basic OutputStyleOption::Basic
} else if !(env::var_os("TERM") } else if env::var_os("TERM")
.map(|t| t != "unknown" && t != "dumb") .map(|t| t == "unknown" || t == "dumb")
.unwrap_or(false) .unwrap_or(true)
&& env::var_os("NO_COLOR") || env::var_os("NO_COLOR")
.map(|t| t.is_empty()) .map(|t| !t.is_empty())
.unwrap_or(true)) .unwrap_or(false)
{ {
OutputStyleOption::NoColor OutputStyleOption::NoColor
} else { } else {