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

@ -504,9 +504,9 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
for sp in spans {
let msg = if sp == last_bound_span {
format!(
"...because of {} bound{}",
if bounds.len() <= 2 { "this" } else { "these" },
if bounds.len() <= 2 { "" } else { "s" },
"...because of {these} bound{s}",
these = pluralize!("this", bounds.len() - 1),
s = pluralize!(bounds.len() - 1),
)
} else {
String::new()