aboutsummaryrefslogtreecommitdiff
path: root/bin/src/fix/single.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/src/fix/single.rs')
-rw-r--r--bin/src/fix/single.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/src/fix/single.rs b/bin/src/fix/single.rs
index 4d492f8..15a2ef4 100644
--- a/bin/src/fix/single.rs
+++ b/bin/src/fix/single.rs
@@ -36,15 +36,13 @@ fn find(offset: TextSize, src: &str) -> Result<Report, SingleFixErr> {
36 .node() 36 .node()
37 .preorder_with_tokens() 37 .preorder_with_tokens()
38 .filter_map(|event| match event { 38 .filter_map(|event| match event {
39 WalkEvent::Enter(child) => { 39 WalkEvent::Enter(child) => LINTS.get(&child.kind()).map(|rules| {
40 LINTS.get(&child.kind()).map(|rules| { 40 rules
41 rules 41 .iter()
42 .iter() 42 .filter_map(|rule| rule.validate(&child))
43 .filter_map(|rule| rule.validate(&child)) 43 .filter(|report| report.total_suggestion_range().is_some())
44 .filter(|report| report.total_suggestion_range().is_some()) 44 .next()
45 .next() 45 }),
46 })
47 }
48 _ => None, 46 _ => None,
49 }) 47 })
50 .flatten() 48 .flatten()