mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Simplify
This commit is contained in:
parent
f5e0a31eaf
commit
434f108ada
8 changed files with 17 additions and 33 deletions
|
@ -44,15 +44,15 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
|
|||
pub(crate) fn validate_body(&mut self, db: &impl HirDatabase) {
|
||||
let body = self.func.body(db);
|
||||
|
||||
for e in body.exprs() {
|
||||
for e in body.exprs.iter() {
|
||||
if let (id, Expr::RecordLit { path, fields, spread }) = e {
|
||||
self.validate_record_literal(id, path, fields, *spread, db);
|
||||
}
|
||||
}
|
||||
|
||||
let body_expr = &body[body.body_expr()];
|
||||
let body_expr = &body[body.body_expr];
|
||||
if let Expr::Block { statements: _, tail: Some(t) } = body_expr {
|
||||
self.validate_results_in_tail_expr(body.body_expr(), *t, db);
|
||||
self.validate_results_in_tail_expr(body.body_expr, *t, db);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue