10786: minor: remove duplicate calls r=Veykril a=XFFXFF

`scopes.set_scope(*expr, scope)` is duplicate, because we always call it in `compute_expr_scopes`  add6cccd4c/crates/hir_def/src/body/scope.rs (L175-L180)

Co-authored-by: zhoufan <1247714429@qq.com>
This commit is contained in:
bors[bot] 2021-11-17 10:39:19 +00:00 committed by GitHub
commit e051ae8f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,18 +151,15 @@ fn compute_block_scopes(
match stmt {
Statement::Let { pat, initializer, else_branch, .. } => {
if let Some(expr) = initializer {
scopes.set_scope(*expr, scope);
compute_expr_scopes(*expr, body, scopes, scope);
}
if let Some(expr) = else_branch {
scopes.set_scope(*expr, scope);
compute_expr_scopes(*expr, body, scopes, scope);
}
scope = scopes.new_scope(scope);
scopes.add_bindings(body, scope, *pat);
}
Statement::Expr { expr, .. } => {
scopes.set_scope(*expr, scope);
compute_expr_scopes(*expr, body, scopes, scope);
}
}