mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Redefine the pluralize macro's arm
This commit is contained in:
parent
fe5f591257
commit
5dce0e66b9
@ -23,8 +23,9 @@ pub mod builtin;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! pluralize {
|
||||
// Pluralize based on count (e.g., apples)
|
||||
($x:expr) => {
|
||||
if $x != 1 { "s" } else { "" }
|
||||
if $x == 1 { "" } else { "s" }
|
||||
};
|
||||
("has", $x:expr) => {
|
||||
if $x == 1 { "has" } else { "have" }
|
||||
|
Loading…
Reference in New Issue
Block a user