Avoid unnecessary color
local variable.
This commit is contained in:
parent
58f45059a5
commit
607bf653c2
1 changed files with 3 additions and 6 deletions
|
@ -347,12 +347,9 @@ impl Diagnostic {
|
||||||
let buf = BufWriter::default();
|
let buf = BufWriter::default();
|
||||||
let mut dst: Destination = Box::new(buf.clone());
|
let mut dst: Destination = Box::new(buf.clone());
|
||||||
let (short, color_config) = je.json_rendered.unzip();
|
let (short, color_config) = je.json_rendered.unzip();
|
||||||
let color = match color_config {
|
match color_config {
|
||||||
ColorConfig::Always | ColorConfig::Auto => true,
|
ColorConfig::Always | ColorConfig::Auto => dst = Box::new(termcolor::Ansi::new(dst)),
|
||||||
ColorConfig::Never => false,
|
ColorConfig::Never => {}
|
||||||
};
|
|
||||||
if color {
|
|
||||||
dst = Box::new(termcolor::Ansi::new(dst));
|
|
||||||
}
|
}
|
||||||
HumanEmitter::new(dst, je.fallback_bundle.clone())
|
HumanEmitter::new(dst, je.fallback_bundle.clone())
|
||||||
.short_message(short)
|
.short_message(short)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue