aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r--lib/src/lib.rs6
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