aboutsummaryrefslogtreecommitdiff
path: root/lib/src/lints/legacy_let_syntax.rs
diff options
context:
space:
mode:
authorAkshay <nerdy@peppe.rs>2021-10-19 17:57:23 +0100
committerAkshay <nerdy@peppe.rs>2021-10-19 17:57:23 +0100
commitb26272ba3e9067197e0aff16ba2ce8780e0acb96 (patch)
treedd97ddf664bd2255e9617bbdf41364134003c8cb /lib/src/lints/legacy_let_syntax.rs
parentea2e23496672257dd1728ce36259249c3efb8aec (diff)
minor refactor
Diffstat (limited to 'lib/src/lints/legacy_let_syntax.rs')
-rw-r--r--lib/src/lints/legacy_let_syntax.rs7
1 files changed, 3 insertions, 4 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";