1
Fork 0

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
commit e0f88b3e9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) {