From a60429891fe9eb5290f95a52dd5e56f62d25d344 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 2 Oct 2021 10:50:47 +0530 Subject: new lint: empty-let-in --- lib/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/src/lib.rs') diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 93792d4..ab4a14a 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -32,7 +32,7 @@ impl Report { self } /// Add a diagnostic with a fix to this report - pub fn suggest(mut self, at: TextRange, message: String, suggestion: Suggestion) -> Self { + pub fn suggest>(mut self, at: TextRange, message: S, suggestion: Suggestion) -> Self { self.diagnostics.push(Diagnostic::suggest(at, message, suggestion)); self } @@ -54,8 +54,8 @@ impl Diagnostic { Self { at, message, suggestion: None } } /// Construct a diagnostic with a fix. - pub fn suggest(at: TextRange, message: String, suggestion: Suggestion) -> Self { - Self { at, message, suggestion: Some(suggestion) } + pub fn suggest>(at: TextRange, message: S, suggestion: Suggestion) -> Self { + Self { at, message: message.as_ref().into(), suggestion: Some(suggestion) } } } -- cgit v1.2.3