mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 17:11:28 +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)
|
|| !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 {
|
||||||
|
|||||||
Reference in new issue
Block a user