Support other types of pluralization in pluralize macro
This commit is contained in:
parent
bce19cf7f1
commit
3bf9124f14
8 changed files with 26 additions and 23 deletions
|
@ -400,7 +400,7 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> {
|
|||
Pointer::new(*alloc, access.access_offset),
|
||||
access.uninit_size.bytes(),
|
||||
pluralize!(access.uninit_size.bytes()),
|
||||
if access.uninit_size.bytes() != 1 { "are" } else { "is" },
|
||||
pluralize!("is", access.uninit_size.bytes()),
|
||||
Pointer::new(*alloc, access.uninit_offset),
|
||||
),
|
||||
InvalidUninitBytes(None) => write!(
|
||||
|
|
|
@ -847,7 +847,7 @@ fn foo(&self) -> Self::T { String::new() }
|
|||
"{some} method{s} {are} available that return{r} `{ty}`",
|
||||
some = if methods.len() == 1 { "a" } else { "some" },
|
||||
s = pluralize!(methods.len()),
|
||||
are = if methods.len() == 1 { "is" } else { "are" },
|
||||
are = pluralize!("is", methods.len()),
|
||||
r = if methods.len() == 1 { "s" } else { "" },
|
||||
ty = expected
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue