1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-31 12:37:45 +00:00

refactor: rename changed to formatted

This commit is contained in:
Kevin Amado 2022-08-05 17:18:53 -06:00
parent b58e560971
commit ac74bc5ce3
2 changed files with 8 additions and 9 deletions

View file

@ -1,2 +1,2 @@
If Alejandra is useful to you, please add your star to the repository. If Alejandra is useful to you, please add your star to the repository.
Thank you! https://github.com/sponsors/kamadorueda Thank you! https://github.com/kamadorueda/alejandra

View file

@ -84,7 +84,7 @@ pub(crate) fn simple(
if !quiet { if !quiet {
eprintln!( eprintln!(
"{} {paths_len} file{} using {threads} thread{}.", "{} {paths_len} file{} using {threads} thread{}.",
if in_place { "Formatting" } else { "Checking style in" }, "Checking style in",
if paths_len == 1 { "" } else { "s" }, if paths_len == 1 { "" } else { "s" },
if threads == 1 { "" } else { "s" }, if threads == 1 { "" } else { "s" },
); );
@ -107,7 +107,7 @@ pub(crate) fn simple(
println!( println!(
"{}: {path}", "{}: {path}",
if in_place { if in_place {
"Changed" "Formatted"
} else { } else {
"Requires formatting" "Requires formatting"
}, },
@ -187,12 +187,11 @@ pub fn main() -> std::io::Result<()> {
"{}! {changed} file{} {}.", "{}! {changed} file{} {}.",
if in_place { "Success" } else { "Alert" }, if in_place { "Success" } else { "Alert" },
if changed == 1 { "" } else { "s" }, if changed == 1 { "" } else { "s" },
if changed == 1 { match (changed == 1, in_place) {
if in_place { "was changed" } else { "requires formatting" } (false, true) => "were formatted",
} else if in_place { (false, false) => "require formatting",
"were changed" (true, true) => "was formatted",
} else { (true, false) => "requires formatting",
"require formatting"
} }
); );
} }