ok/jj
1
0
Fork 0
forked from mirrors/jj

formatter: minor cleanup in --color=debug handling

This commit is contained in:
Yuya Nishihara 2024-07-12 17:16:07 +09:00
parent 5aa08042c5
commit 8ee5b783b3

View file

@ -284,7 +284,7 @@ impl<W: Write> ColorFormatter<W> {
labels: vec![],
cached_styles: HashMap::new(),
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 {
Some(current) => {
let joined = self.labels.join(" ");
if joined.eq(current) {
if joined == *current {
None
} else {
if !current.is_empty() {