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)
{
OutputStyleOption::Basic
} else if !(env::var_os("TERM")
.map(|t| t != "unknown" && t != "dumb")
.unwrap_or(false)
&& env::var_os("NO_COLOR")
.map(|t| t.is_empty())
.unwrap_or(true))
} else if env::var_os("TERM")
.map(|t| t == "unknown" || t == "dumb")
.unwrap_or(true)
|| env::var_os("NO_COLOR")
.map(|t| !t.is_empty())
.unwrap_or(false)
{
OutputStyleOption::NoColor
} else {