diff options
author | Akshay <[email protected]> | 2021-10-28 03:20:36 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-28 03:20:36 +0100 |
commit | 3c9a675b9d776bf2210803d582e9af88f9df2631 (patch) | |
tree | 6b3b88fe4040cc904922b4b084442dbcf20495ae /bin/src/fix | |
parent | 8eccf15964e09c2e024710512e671c6b1b88e885 (diff) |
fix fp with manual_inherit and manual_inherit_from
the lint also needed to validate if the length of the path component was
exactly one, and not just check if the first component matches the
value.
Diffstat (limited to 'bin/src/fix')
-rw-r--r-- | bin/src/fix/single.rs | 16 |
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() |