Description
The following pattern is common in diagnostic messages in rustc:
format!("found {} thing{}", x, if x != 1 { "s" } else { "" })
It would be good to extract all of these pluralisation checks into a function or macro:
format!("found {} thing{}", x, pluralise(x))
There's already one in src/librustc/ty/error.rs, but it's not used anywhere else, so we could move it to somewhere in src/librustc_errors, and replace the occurrences of this pattern with the macro.
Lines 85 to 89 in 0b97726
This issue has been assigned to @V1shvesh via this comment.
Metadata
Metadata
Assignees
Labels
Category: PRs that clean code up or issues documenting cleanup.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Help is requested to fix this issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.