1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-08-01 21:17:45 +00:00

fix: plural conditions

This commit is contained in:
Kevin Amado 2022-03-08 17:39:05 -05:00
parent 511c3f6a88
commit 71f071e857

View file

@ -384,7 +384,7 @@ pub fn main() -> std::io::Result<()> {
eprintln!( eprintln!(
"Failed! We encountered {} error{} at:", "Failed! We encountered {} error{} at:",
errors, errors,
if errors > 0 { "s" } else { "" } if errors >= 2 { "s" } else { "" }
); );
for formatted_path in formatted_paths { for formatted_path in formatted_paths {
if let alejandra_engine::format::Status::Error(error) = if let alejandra_engine::format::Status::Error(error) =
@ -409,8 +409,8 @@ pub fn main() -> std::io::Result<()> {
eprintln!( eprintln!(
"Success! {} file{} {} changed", "Success! {} file{} {} changed",
changed, changed,
if changed > 0 { "s" } else { "" }, if changed >= 2 { "s" } else { "" },
if changed > 0 { "were" } else { "was" }, if changed >= 2 { "were" } else { "was" },
); );
if check { if check {
std::process::exit(2); std::process::exit(2);