forked from mirrors/jj
formatter: minor cleanup in --color=debug handling
This commit is contained in:
parent
5aa08042c5
commit
8ee5b783b3
1 changed files with 2 additions and 2 deletions
|
@ -284,7 +284,7 @@ impl<W: Write> ColorFormatter<W> {
|
||||||
labels: vec![],
|
labels: vec![],
|
||||||
cached_styles: HashMap::new(),
|
cached_styles: HashMap::new(),
|
||||||
current_style: Style::default(),
|
current_style: Style::default(),
|
||||||
current_debug: if debug { Some(String::new()) } else { None },
|
current_debug: debug.then(String::new),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ impl<W: Write> ColorFormatter<W> {
|
||||||
let new_debug = match &self.current_debug {
|
let new_debug = match &self.current_debug {
|
||||||
Some(current) => {
|
Some(current) => {
|
||||||
let joined = self.labels.join(" ");
|
let joined = self.labels.join(" ");
|
||||||
if joined.eq(current) {
|
if joined == *current {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
if !current.is_empty() {
|
if !current.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue