about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/json.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index 77e4f9a0767..bc1822f83fc 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -347,12 +347,9 @@ impl Diagnostic {
         let buf = BufWriter::default();
         let mut dst: Destination = Box::new(buf.clone());
         let (short, color_config) = je.json_rendered.unzip();
-        let color = match color_config {
-            ColorConfig::Always | ColorConfig::Auto => true,
-            ColorConfig::Never => false,
-        };
-        if color {
-            dst = Box::new(termcolor::Ansi::new(dst));
+        match color_config {
+            ColorConfig::Always | ColorConfig::Auto => dst = Box::new(termcolor::Ansi::new(dst)),
+            ColorConfig::Never => {}
         }
         HumanEmitter::new(dst, je.fallback_bundle.clone())
             .short_message(short)