From 3c9a675b9d776bf2210803d582e9af88f9df2631 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 28 Oct 2021 07:50:36 +0530 Subject: 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. --- bin/src/fix/single.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'bin/src/fix/single.rs') 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 { .node() .preorder_with_tokens() .filter_map(|event| match event { - WalkEvent::Enter(child) => { - LINTS.get(&child.kind()).map(|rules| { - rules - .iter() - .filter_map(|rule| rule.validate(&child)) - .filter(|report| report.total_suggestion_range().is_some()) - .next() - }) - } + WalkEvent::Enter(child) => LINTS.get(&child.kind()).map(|rules| { + rules + .iter() + .filter_map(|rule| rule.validate(&child)) + .filter(|report| report.total_suggestion_range().is_some()) + .next() + }), _ => None, }) .flatten() -- cgit v1.2.3