aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorfigsoda <[email protected]>2021-11-02 02:34:22 +0000
committerfigsoda <[email protected]>2021-11-02 02:34:22 +0000
commit831bd7e91d1f97f565d6ea15d816e638a983ad00 (patch)
treec042af6b11ff77ac462c19f84bff748f210729cc /lib
parent90ea9335b55efb38802a2983a58580b3bc568c5f (diff)
apply clippy lints
Diffstat (limited to 'lib')
-rw-r--r--lib/src/lints/eta_reduction.rs4
-rw-r--r--lib/src/lints/unquoted_splice.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/src/lints/eta_reduction.rs b/lib/src/lints/eta_reduction.rs
index 9df3f1e..454c78f 100644
--- a/lib/src/lints/eta_reduction.rs
+++ b/lib/src/lints/eta_reduction.rs
@@ -67,7 +67,7 @@ impl Rule for EtaReduction {
67 let message = 67 let message =
68 format!( 68 format!(
69 "Found eta-reduction: `{}`", 69 "Found eta-reduction: `{}`",
70 replacement.text().to_string() 70 replacement.text()
71 ); 71 );
72 Some(self.report().suggest(at, message, Suggestion::new(at, replacement))) 72 Some(self.report().suggest(at, message, Suggestion::new(at, replacement)))
73 } else { 73 } else {
@@ -81,6 +81,6 @@ fn mentions_ident(ident: &Ident, node: &SyntaxNode) -> bool {
81 if let Some(node_ident) = Ident::cast(node.clone()) { 81 if let Some(node_ident) = Ident::cast(node.clone()) {
82 node_ident.as_str() == ident.as_str() 82 node_ident.as_str() == ident.as_str()
83 } else { 83 } else {
84 node.children().any(|child| mentions_ident(&ident, &child)) 84 node.children().any(|child| mentions_ident(ident, &child))
85 } 85 }
86} 86}
diff --git a/lib/src/lints/unquoted_splice.rs b/lib/src/lints/unquoted_splice.rs
index 4700d31..ce269b6 100644
--- a/lib/src/lints/unquoted_splice.rs
+++ b/lib/src/lints/unquoted_splice.rs
@@ -46,7 +46,7 @@ impl Rule for UnquotedSplice {
46 if Dynamic::cast(node.clone()).is_some(); 46 if Dynamic::cast(node.clone()).is_some();
47 then { 47 then {
48 let at = node.text_range(); 48 let at = node.text_range();
49 let replacement = make::quote(&node).node().clone(); 49 let replacement = make::quote(node).node().clone();
50 let message = "Consider quoting this splice expression"; 50 let message = "Consider quoting this splice expression";
51 Some(self.report().suggest(at, message, Suggestion::new(at, replacement))) 51 Some(self.report().suggest(at, message, Suggestion::new(at, replacement)))
52 } else { 52 } else {