Skip to content

Commit 454e6b9

Browse files
committed
fix clippy lints
1 parent 4ac597a commit 454e6b9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/plumbing/progress.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)