Skip to content

Commit

Permalink
Use writeln! instead of write!("\n")
Browse files Browse the repository at this point in the history
  • Loading branch information
DJ-Laser committed Dec 7, 2024
1 parent b1a8f25 commit 45ed6fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions djlaser_catsay/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ where
write!(stdout, "{}", get_credits())?;
} else if args.action.list_cats {
for cat in Cat::CATS {
write!(stdout, "--cat {}: {}", cat.name, cat.credit)?;
write!(stdout, "\n")?;
writeln!(stdout, "--cat {}: {}", cat.name, cat.credit)?;
}
} else if args.action.show_cats {
for cat in Cat::CATS {
let text = format!("--cat {}:\n{}", cat.name, cat.credit);
options.set_cat(cat);
write!(stdout, "{}\n", say(&text, &options))?;
writeln!(stdout, "{}", say(&text, &options))?;
}
} else if let Some(name) = args.action.show_cat {
let cat = try_get_cat(&name, &mut stderr)?;
Expand Down

0 comments on commit 45ed6fb

Please sign in to comment.