progress/plain: Fix label alignment

This commit is contained in:
Zhaofeng Li 2021-11-21 16:02:45 -08:00
parent 46090598eb
commit b3016ad3a7

View file

@ -32,11 +32,15 @@ impl PlainOutput {
}
}
fn print(&self, line: Line) {
fn print(&mut self, line: Line) {
if line.noisy {
return;
}
if line.label.len() > self.label_width {
self.label_width = line.label.len();
}
let label_style = match line.style {
LineStyle::Normal => {
ConsoleStyle::new().bold()
@ -82,7 +86,6 @@ impl ProgressOutput for PlainOutput {
let message = self.receiver.recv().await;
if message.is_none() {
log::info!("All senders dropped");
return Ok(self);
}