Skip to content

Commit 5dce0e6

Browse files
Redefine the pluralize macro's arm
1 parent fe5f591 commit 5dce0e6

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_lint_defs/src

1 file changed

+2
-1
lines changed

compiler/rustc_lint_defs/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ pub mod builtin;
2323

2424
#[macro_export]
2525
macro_rules! pluralize {
26+
// Pluralize based on count (e.g., apples)
2627
($x:expr) => {
27-
if $x != 1 { "s" } else { "" }
28+
if $x == 1 { "" } else { "s" }
2829
};
2930
("has", $x:expr) => {
3031
if $x == 1 { "has" } else { "have" }

0 commit comments

Comments
 (0)