simplify borrowing
This commit is contained in:
parent
210e46bf24
commit
1d5accabf1
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue