diff options
Diffstat (limited to 'lib/src')
-rw-r--r-- | lib/src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 4065345..4374ac7 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs | |||
@@ -112,7 +112,7 @@ pub trait Metadata { | |||
112 | where | 112 | where |
113 | Self: Sized; | 113 | Self: Sized; |
114 | fn match_with(&self, with: &SyntaxKind) -> bool; | 114 | fn match_with(&self, with: &SyntaxKind) -> bool; |
115 | fn match_kind(&self) -> SyntaxKind; | 115 | fn match_kind(&self) -> Vec<SyntaxKind>; |
116 | } | 116 | } |
117 | 117 | ||
118 | /// Combines Rule and Metadata, do not implement manually, this is derived by | 118 | /// Combines Rule and Metadata, do not implement manually, this is derived by |
@@ -140,10 +140,12 @@ macro_rules! lint_map { | |||
140 | $( | 140 | $( |
141 | { | 141 | { |
142 | let temp_lint = &*$s::LINT; | 142 | let temp_lint = &*$s::LINT; |
143 | let temp_match = temp_lint.match_kind(); | 143 | let temp_matches = temp_lint.match_kind(); |
144 | map.entry(temp_match) | 144 | for temp_match in temp_matches { |
145 | .and_modify(|v: &mut Vec<_>| v.push(temp_lint)) | 145 | map.entry(temp_match) |
146 | .or_insert_with(|| vec![temp_lint]); | 146 | .and_modify(|v: &mut Vec<_>| v.push(temp_lint)) |
147 | .or_insert_with(|| vec![temp_lint]); | ||
148 | } | ||
147 | } | 149 | } |
148 | )* | 150 | )* |
149 | map | 151 | map |