]> git.lizzy.rs Git - rust.git/commitdiff
Use pluralize in one instance
authorest31 <MTest31@outlook.com>
Fri, 13 May 2022 06:48:35 +0000 (08:48 +0200)
committerest31 <MTest31@outlook.com>
Fri, 13 May 2022 06:48:35 +0000 (08:48 +0200)
compiler/rustc_expand/src/mbe/macro_parser.rs

index 29f354d572802bc0664b0df3ff79732d9e415912..ddfbef945efaa29bbef4a0ce98812f0304e36b35 100644 (file)
@@ -76,6 +76,7 @@
 use crate::mbe::{KleeneOp, TokenTree};
 
 use rustc_ast::token::{self, DocComment, Nonterminal, NonterminalKind, Token};
+use rustc_lint_defs::pluralize;
 use rustc_parse::parser::{NtOrTt, Parser};
 use rustc_span::symbol::MacroRulesNormalizedIdent;
 use rustc_span::Span;
@@ -668,8 +669,7 @@ fn ambiguity_error(
                 self.macro_name,
                 match self.next_mps.len() {
                     0 => format!("built-in NTs {}.", nts),
-                    1 => format!("built-in NTs {} or 1 other option.", nts),
-                    n => format!("built-in NTs {} or {} other options.", nts, n),
+                    n => format!("built-in NTs {} or {n} other option{s}.", nts, s = pluralize!(n)),
                 }
             ),
         )