diff options
| author | V1shvesh <22243137+V1shvesh@users.noreply.github.com> | 2019-09-08 14:57:03 +0530 |
|---|---|---|
| committer | V1shvesh <22243137+V1shvesh@users.noreply.github.com> | 2019-09-08 15:09:50 +0530 |
| commit | 38ab20dbf7469aa5a3cb0d7bfd3700281aa46467 (patch) | |
| tree | b1778255210cb800b7d40eb133b36518d45c23ac /src/librustc_errors | |
| parent | 4a8ccdbeeb346e80417bd6b5c9cb7d62e225659d (diff) | |
| download | rust-38ab20dbf7469aa5a3cb0d7bfd3700281aa46467.tar.gz rust-38ab20dbf7469aa5a3cb0d7bfd3700281aa46467.zip | |
Add pluralise macro
Adress issue #64238. Create a macro to be used for pluralisation check throughout rustc codebase.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 6585633e00a..b5341a2b727 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -845,3 +845,11 @@ impl Level { } } } + +#[macro_export] +macro_rules! pluralise { + ($x:expr) => { + if $x != 1 { "s" } else { "" } + }; +} + |
