File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -318,18 +318,6 @@ impl EarlyLintPass for MiscEarlyLints {
318318 return ;
319319 }
320320 if wilds > 0 {
321- let mut normal = vec ! [ ] ;
322-
323- for field in pfields {
324- match field. pat . kind {
325- PatKind :: Wild => { } ,
326- _ => {
327- if let Ok ( n) = cx. sess ( ) . source_map ( ) . span_to_snippet ( field. span ) {
328- normal. push ( n) ;
329- }
330- } ,
331- }
332- }
333321 for field in pfields {
334322 if let PatKind :: Wild = field. pat . kind {
335323 wilds -= 1 ;
@@ -341,6 +329,19 @@ impl EarlyLintPass for MiscEarlyLints {
341329 "You matched a field with a wildcard pattern. Consider using `..` instead" ,
342330 ) ;
343331 } else {
332+ let mut normal = vec ! [ ] ;
333+
334+ for field in pfields {
335+ match field. pat . kind {
336+ PatKind :: Wild => { } ,
337+ _ => {
338+ if let Ok ( n) = cx. sess ( ) . source_map ( ) . span_to_snippet ( field. span ) {
339+ normal. push ( n) ;
340+ }
341+ } ,
342+ }
343+ }
344+
344345 span_lint_and_help (
345346 cx,
346347 UNNEEDED_FIELD_PATTERN ,
You can’t perform that action at this time.
0 commit comments