File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,7 +511,7 @@ pub fn show_progress() -> anyhow::Result<()> {
511511
512512 let width: Option < usize > = terminal_size:: terminal_size ( )
513513 . map ( |( width, _height) | width. 0 )
514- . map ( |w| w . into ( ) ) ;
514+ . map ( std :: convert :: Into :: into) ;
515515
516516 let mut stdout = std:: io:: stdout ( ) . lock ( ) ;
517517 for Record { config, usage } in & sorted {
@@ -522,14 +522,13 @@ pub fn show_progress() -> anyhow::Result<()> {
522522 let icon_and_config_width = 55 ;
523523 let width_after_config = width - icon_and_config_width;
524524 let usage = usage. to_string ( ) ;
525- let mut usage = usage. split ( " " ) ;
526525 let mut idx = 0 ;
527- while let Some ( word) = usage. next ( ) {
526+ for word in usage. split ( ' ' ) {
528527 // +1 for the space after each word
529528 let word_len = word. chars ( ) . count ( ) + 1 ;
530529
531530 if idx + word_len > width_after_config {
532- write ! ( stdout, " \n " ) ?;
531+ writeln ! ( stdout) ?;
533532 for _ in 0 ..icon_and_config_width {
534533 write ! ( stdout, " " ) ?;
535534 }
@@ -539,7 +538,7 @@ pub fn show_progress() -> anyhow::Result<()> {
539538 write ! ( stdout, "{word} " ) ?;
540539 idx += word_len;
541540 }
542- writeln ! ( stdout, "" ) ?;
541+ writeln ! ( stdout) ?;
543542 } else {
544543 writeln ! ( stdout, "{usage}" ) ?;
545544 }
You can’t perform that action at this time.
0 commit comments