Support other types of pluralization in pluralize macro

This commit is contained in:
est31 2022-03-14 17:55:14 +01:00
parent bce19cf7f1
commit 3bf9124f14
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()