aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lints
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/lints')
-rw-r--r--lib/src/lints/legacy_let_syntax.rs7
-rw-r--r--lib/src/lints/manual_inherit.rs2
-rw-r--r--lib/src/lints/manual_inherit_from.rs2
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/src/lints/legacy_let_syntax.rs b/lib/src/lints/legacy_let_syntax.rs
index c5588e2..2087e27 100644
--- a/lib/src/lints/legacy_let_syntax.rs
+++ b/lib/src/lints/legacy_let_syntax.rs
@@ -23,15 +23,14 @@ impl Rule for ManualInherit {
23 23
24 if legacy_let 24 if legacy_let
25 .entries() 25 .entries()
26 .find(|kv| matches!(kv.key(), Some(k) if key_is_ident(&k, "body"))) 26 .any(|kv| matches!(kv.key(), Some(k) if key_is_ident(&k, "body")));
27 .is_some();
28 27
29 then { 28 then {
30 let inherits = legacy_let.inherits(); 29 let inherits = legacy_let.inherits();
31 let entries = legacy_let.entries(); 30 let entries = legacy_let.entries();
32 let attrset = make::attrset(inherits, entries, true); 31 let attrset = make::attrset(inherits, entries, true);
33 let parenthesized = make::parenthesize(&attrset.node()); 32 let parenthesized = make::parenthesize(attrset.node());
34 let selected = make::select(parenthesized.node(), &make::ident("body").node()); 33 let selected = make::select(parenthesized.node(), make::ident("body").node());
35 34
36 let at = node.text_range(); 35 let at = node.text_range();
37 let message = "Prefer `rec` over undocumented `let` syntax"; 36 let message = "Prefer `rec` over undocumented `let` syntax";
diff --git a/lib/src/lints/manual_inherit.rs b/lib/src/lints/manual_inherit.rs
index 3524dd3..69f032b 100644
--- a/lib/src/lints/manual_inherit.rs
+++ b/lib/src/lints/manual_inherit.rs
@@ -32,7 +32,7 @@ impl Rule for ManualInherit {
32 then { 32 then {
33 let at = node.text_range(); 33 let at = node.text_range();
34 let replacement = make::inherit_stmt(&[key]).node().clone(); 34 let replacement = make::inherit_stmt(&[key]).node().clone();
35 let message = format!("This assignment is better written with `inherit`"); 35 let message = "This assignment is better written with `inherit`";
36 Some(Self::report().suggest(at, message, Suggestion::new(at, replacement))) 36 Some(Self::report().suggest(at, message, Suggestion::new(at, replacement)))
37 } else { 37 } else {
38 None 38 None
diff --git a/lib/src/lints/manual_inherit_from.rs b/lib/src/lints/manual_inherit_from.rs
index d7a00b2..2bff5f8 100644
--- a/lib/src/lints/manual_inherit_from.rs
+++ b/lib/src/lints/manual_inherit_from.rs
@@ -37,7 +37,7 @@ impl Rule for ManualInherit {
37 let set = value.set()?; 37 let set = value.set()?;
38 make::inherit_from_stmt(set, &[key]).node().clone() 38 make::inherit_from_stmt(set, &[key]).node().clone()
39 }; 39 };
40 let message = format!("This assignment is better written with `inherit`"); 40 let message = "This assignment is better written with `inherit`";
41 Some(Self::report().suggest(at, message, Suggestion::new(at, replacement))) 41 Some(Self::report().suggest(at, message, Suggestion::new(at, replacement)))
42 } else { 42 } else {
43 None 43 None