about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-22 14:22:10 +0000
committerbors <bors@rust-lang.org>2023-08-22 14:22:10 +0000
commit3e9e5745dfd3ad9a553a4c7d2b3d125dc1473fa6 (patch)
treedd81fa640bc1e0ddf628cc35dbd70af1f260414c /compiler/rustc_codegen_gcc
parentd8c69dfb37241a2b750a2acbbab48d1201d00766 (diff)
parent5dce0e66b9424ed1070e5b37ca21ffee62957595 (diff)
downloadrust-3e9e5745dfd3ad9a553a4c7d2b3d125dc1473fa6.tar.gz
rust-3e9e5745dfd3ad9a553a4c7d2b3d125dc1473fa6.zip
Auto merge of #115066 - allaboutevemirolive:pluralize_macro, r=Nilstrieb
Redefine the pluralize macro's arm

Redefine the unintuitive pluralize macro's arm because of the negation. The initial code starts with check if count is not 1, which is confusing and unintuitive.

The arm shoud start with checking,

- if "count" `is 1` then, append `""` (empty string) - indicate as singular
- Then check if "count" `is not 1` (more than 1), append `"s"` - indicate as plural

Before:
```rs
// This arm is abit confusing since it start with checking, if "count" is more than 1, append "s".
($x:expr) => {
    if $x != 1 { "s" } else { "" }
};
```

After:
```rs
// Pluralize based on count (e.g., apples)
($x:expr) => {
    if $x == 1 { "" } else { "s" }
};
```
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions