File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -511,7 +511,7 @@ pub fn show_progress() -> anyhow::Result<()> {
511
511
512
512
let width: Option < usize > = terminal_size:: terminal_size ( )
513
513
. map ( |( width, _height) | width. 0 )
514
- . map ( |w| w . into ( ) ) ;
514
+ . map ( std :: convert :: Into :: into) ;
515
515
516
516
let mut stdout = std:: io:: stdout ( ) . lock ( ) ;
517
517
for Record { config, usage } in & sorted {
@@ -522,14 +522,13 @@ pub fn show_progress() -> anyhow::Result<()> {
522
522
let icon_and_config_width = 55 ;
523
523
let width_after_config = width - icon_and_config_width;
524
524
let usage = usage. to_string ( ) ;
525
- let mut usage = usage. split ( " " ) ;
526
525
let mut idx = 0 ;
527
- while let Some ( word) = usage. next ( ) {
526
+ for word in usage. split ( ' ' ) {
528
527
// +1 for the space after each word
529
528
let word_len = word. chars ( ) . count ( ) + 1 ;
530
529
531
530
if idx + word_len > width_after_config {
532
- write ! ( stdout, " \n " ) ?;
531
+ writeln ! ( stdout) ?;
533
532
for _ in 0 ..icon_and_config_width {
534
533
write ! ( stdout, " " ) ?;
535
534
}
@@ -539,7 +538,7 @@ pub fn show_progress() -> anyhow::Result<()> {
539
538
write ! ( stdout, "{word} " ) ?;
540
539
idx += word_len;
541
540
}
542
- writeln ! ( stdout, "" ) ?;
541
+ writeln ! ( stdout) ?;
543
542
} else {
544
543
writeln ! ( stdout, "{usage}" ) ?;
545
544
}
You can’t perform that action at this time.
0 commit comments