From faa25f9e677bfc9d5559fdac2278559ffb685b9b Mon Sep 17 00:00:00 2001 From: Abyss Date: Sat, 31 Jul 2021 18:12:54 -0400 Subject: [PATCH] Make colorizer respect `ColorChoice::Always` --- src/output/fmt.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/output/fmt.rs b/src/output/fmt.rs index e385defe208..6c898b92026 100644 --- a/src/output/fmt.rs +++ b/src/output/fmt.rs @@ -65,10 +65,10 @@ impl Colorizer { pub(crate) fn print(&self) -> io::Result<()> { use termcolor::{BufferWriter, ColorSpec, WriteColor}; - let color_when = if is_a_tty(self.use_stderr) { - self.color_when - } else { - ColorChoice::Never + let color_when = match self.color_when { + always @ ColorChoice::Always => always, + choice if is_a_tty(self.use_stderr) => choice, + _ => ColorChoice::Never, }; let writer = if self.use_stderr {