1
Fork 0

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