mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Rewrite boolean condition
This commit is contained in:
1 parent
049d1138c9
commit
9fefe9af31
1 file changed
+6
-6
+6
-6
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user