Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine the pluralize macro's arm #115066

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Redefine the pluralize macro's arm #115066

merged 1 commit into from
Aug 22, 2023

Conversation

allaboutevemirolive
Copy link
Contributor

@allaboutevemirolive allaboutevemirolive commented Aug 21, 2023

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:

// 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:

// Pluralize based on count (e.g., apples)
($x:expr) => {
    if $x == 1 { "" } else { "s" }
};

@rustbot
Copy link
Collaborator

rustbot commented Aug 21, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 21, 2023
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r? Nilstrieb

@rustbot rustbot assigned Noratrieb and unassigned TaKO8Ki Aug 22, 2023
@Noratrieb
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 22, 2023

📌 Commit 5dce0e6 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2023
@bors
Copy link
Contributor

bors commented Aug 22, 2023

⌛ Testing commit 5dce0e6 with merge 3e9e574...

@bors
Copy link
Contributor

bors commented Aug 22, 2023

☀️ Test successful - checks-actions
Approved by: Nilstrieb
Pushing 3e9e574 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 22, 2023
@bors bors merged commit 3e9e574 into rust-lang:master Aug 22, 2023
@rustbot rustbot added this to the 1.74.0 milestone Aug 22, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3e9e574): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 634.844s -> 634.51s (-0.05%)
Artifact size: 346.96 MiB -> 346.98 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants