diff options
author | Akshay <[email protected]> | 2021-10-02 06:20:47 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-02 06:21:27 +0100 |
commit | a60429891fe9eb5290f95a52dd5e56f62d25d344 (patch) | |
tree | 3623ae9c2204e666adcacf9403599378af49e5e7 /lib/src/lib.rs | |
parent | 2dacf12a3df91f27e5f290dcf495378076da3eed (diff) |
new lint: empty-let-in
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r-- | lib/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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 { | |||
32 | self | 32 | self |
33 | } | 33 | } |
34 | /// Add a diagnostic with a fix to this report | 34 | /// Add a diagnostic with a fix to this report |
35 | pub fn suggest(mut self, at: TextRange, message: String, suggestion: Suggestion) -> Self { | 35 | pub fn suggest<S: AsRef<str>>(mut self, at: TextRange, message: S, suggestion: Suggestion) -> Self { |
36 | self.diagnostics.push(Diagnostic::suggest(at, message, suggestion)); | 36 | self.diagnostics.push(Diagnostic::suggest(at, message, suggestion)); |
37 | self | 37 | self |
38 | } | 38 | } |
@@ -54,8 +54,8 @@ impl Diagnostic { | |||
54 | Self { at, message, suggestion: None } | 54 | Self { at, message, suggestion: None } |
55 | } | 55 | } |
56 | /// Construct a diagnostic with a fix. | 56 | /// Construct a diagnostic with a fix. |
57 | pub fn suggest(at: TextRange, message: String, suggestion: Suggestion) -> Self { | 57 | pub fn suggest<S: AsRef<str>>(at: TextRange, message: S, suggestion: Suggestion) -> Self { |
58 | Self { at, message, suggestion: Some(suggestion) } | 58 | Self { at, message: message.as_ref().into(), suggestion: Some(suggestion) } |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||