From ca8ccda114bf4e8624c91a57ec9e1a128f0cc7f0 Mon Sep 17 00:00:00 2001 From: mi_sawa Date: Sun, 30 Jun 2024 14:03:28 +0900 Subject: [PATCH] Use var_os instead of var --- src/bin/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 62abcf1..cc14bc0 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -231,7 +231,7 @@ fn run_with_input(cli: Cli, input: impl Input) -> Result<()> { match output_format { SerializationFormat::Json => { let is_stdout_terminal = stdout().is_terminal(); - let no_color_from_env = || std::env::var("NO_COLOR").is_ok_and(|s| !s.is_empty()); + let no_color_from_env = || std::env::var_os("NO_COLOR").is_some_and(|s| !s.is_empty()); let should_colorize_output = cli.output_format.color_output || (is_stdout_terminal && !cli.output_format.monochrome_output