From ddd326fda4358df67f1efa185e1f16e9acf3d234 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 27 Jul 2022 10:09:06 +0900 Subject: use `pluralize!` --- compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 2f92a77a795..0c38c829760 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -634,9 +634,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) { -- cgit 1.4.1-3-g733a5