early linting: avoid redundant calls to check_id

This commit is contained in:
Deadbeef
2025-06-12 14:01:47 +08:00
parent 14346303d7
commit ae8ca1f858
3 changed files with 18 additions and 29 deletions

View File

@@ -1700,7 +1700,8 @@ fn visit_nested_use_tree<'a, V: Visitor<'a>>(
}
pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) -> V::Result {
let Stmt { id: _, kind, span: _ } = statement;
let Stmt { id, kind, span: _ } = statement;
try_visit!(visit_id(visitor, id));
match kind {
StmtKind::Let(local) => try_visit!(visitor.visit_local(local)),
StmtKind::Item(item) => try_visit!(visitor.visit_item(item)),