From d04f3604d5b054674720276900ebc35564e2df96 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 9 Jul 2020 15:50:53 +0200 Subject: [PATCH] Correctly pluralize message --- crates/ra_hir_ty/src/diagnostics.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index daac669e65..5b0dda634f 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs @@ -208,7 +208,8 @@ pub struct MismatchedArgCount { impl Diagnostic for MismatchedArgCount { fn message(&self) -> String { - format!("Expected {} arguments, found {}", self.expected, self.found) + let s = if self.expected == 1 { "" } else { "s" }; + format!("Expected {} argument{}, found {}", self.expected, s, self.found) } fn source(&self) -> InFile { InFile { file_id: self.file, value: self.call_expr.clone().into() }