@@ -162,11 +162,8 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
162
162
// Explicitly check for lints associated with 'closure_id', since
163
163
// it does not have a corresponding AST node
164
164
if let ast_visit:: FnKind :: Fn ( _, _, sig, _, _, _) = fk {
165
- if let Some ( coro_kind) = sig. header . coroutine_kind {
166
- let ( ast:: CoroutineKind :: Async { closure_id, .. }
167
- | ast:: CoroutineKind :: Gen { closure_id, .. }
168
- | ast:: CoroutineKind :: AsyncGen { closure_id, .. } ) = coro_kind;
169
- self . check_id ( closure_id) ;
165
+ if let Some ( coroutine_kind) = sig. header . coroutine_kind {
166
+ self . check_id ( coroutine_kind. closure_id ( ) ) ;
170
167
}
171
168
}
172
169
}
@@ -226,12 +223,10 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
226
223
// it does not have a corresponding AST node
227
224
match e. kind {
228
225
ast:: ExprKind :: Closure ( box ast:: Closure {
229
- coroutine_kind : Some ( coro_kind) , ..
226
+ coroutine_kind : Some ( coroutine_kind) ,
227
+ ..
230
228
} ) => {
231
- let ( ast:: CoroutineKind :: Async { closure_id, .. }
232
- | ast:: CoroutineKind :: Gen { closure_id, .. }
233
- | ast:: CoroutineKind :: AsyncGen { closure_id, .. } ) = coro_kind;
234
- self . check_id ( closure_id) ;
229
+ self . check_id ( coroutine_kind. closure_id ( ) ) ;
235
230
}
236
231
_ => { }
237
232
}
0 commit comments