simplify borrowing

This commit is contained in:
Smitty 2021-06-17 10:15:02 -04:00
parent 210e46bf24
commit 1d5accabf1

View File

@ -146,19 +146,19 @@ pub fn walk_expr<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, expr: &Exp
}
pub fn walk_stmt<'a, 'tcx: 'a, V: Visitor<'a, 'tcx>>(visitor: &mut V, stmt: &Stmt<'tcx>) {
match &stmt.kind {
StmtKind::Expr { expr, scope: _ } => visitor.visit_expr(&visitor.thir()[*expr]),
match stmt.kind {
StmtKind::Expr { expr, scope: _ } => visitor.visit_expr(&visitor.thir()[expr]),
StmtKind::Let {
initializer,
remainder_scope: _,
init_scope: _,
pattern,
ref pattern,
lint_level: _,
} => {
if let Some(init) = initializer {
visitor.visit_expr(&visitor.thir()[*init]);
visitor.visit_expr(&visitor.thir()[init]);
}
visitor.visit_pat(&pattern);
visitor.visit_pat(pattern);
}
}
}