1
Fork 0

Rollup merge of #94958 - est31:pluralize, r=oli-obk

Support other types of pluralization in pluralize macro
This commit is contained in:
Matthias Krüger 2022-03-15 17:15:55 +01:00 committed by GitHub
commit 183262d8d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 23 deletions

View file

@ -20,6 +20,12 @@ macro_rules! pluralize {
($x:expr) => {
if $x != 1 { "s" } else { "" }
};
("is", $x:expr) => {
if $x == 1 { "is" } else { "are" }
};
("this", $x:expr) => {
if $x == 1 { "this" } else { "these" }
};
}
/// Indicates the confidence in the correctness of a suggestion.