]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
use `pluralize!`
[rust.git] / compiler / rustc_trait_selection / src / traits / error_reporting / mod.rs
index 2f92a77a7957d886185adb768ea2c4f09ef8671b..0c38c829760bedf64d8f9dcd67aee5f6dd13af92 100644 (file)
@@ -634,9 +634,9 @@ fn report_selection_error(
                                         &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) {