Rollup merge of #99789 - TaKO8Ki:use-pluralize-macro, r=compiler-errors

Refactor: use `pluralize!`

Use `pluralize!` in more places
This commit is contained in:
Yuki Okushi
2022-07-27 19:05:36 +09:00
committed by GitHub
5 changed files with 10 additions and 12 deletions

View File

@@ -631,9 +631,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
&format!(
"expected a closure taking {} argument{}, but one taking {} argument{} was given",
given.len(),
if given.len() == 1 { "" } else { "s" },
pluralize!(given.len()),
expected.len(),
if expected.len() == 1 { "" } else { "s" },
pluralize!(expected.len()),
)
);
} else if !self.same_type_modulo_infer(given_ty, expected_ty) {