Skip to content

Commit 38ab20d

Browse files
committed
Add pluralise macro
Adress issue #64238. Create a macro to be used for pluralisation check throughout rustc codebase.
1 parent 4a8ccdb commit 38ab20d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_errors/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,11 @@ impl Level {
845845
}
846846
}
847847
}
848+
849+
#[macro_export]
850+
macro_rules! pluralise {
851+
($x:expr) => {
852+
if $x != 1 { "s" } else { "" }
853+
};
854+
}
855+

0 commit comments

Comments
 (0)