Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/diagnostics.rs')
-rw-r--r--crates/hir/src/diagnostics.rs56
1 files changed, 28 insertions, 28 deletions
diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs
index 555270bad8..6cfb79d5a1 100644
--- a/crates/hir/src/diagnostics.rs
+++ b/crates/hir/src/diagnostics.rs
@@ -491,35 +491,35 @@ impl<'db> AnyDiagnostic<'db> {
let file = record.file_id;
let root = record.file_syntax(db);
match record.value.to_node(&root) {
- Either::Left(ast::Expr::RecordExpr(record_expr)) => {
- if record_expr.record_expr_field_list().is_some() {
- let field_list_parent_path =
- record_expr.path().map(|path| AstPtr::new(&path));
- return Some(
- MissingFields {
- file,
- field_list_parent: AstPtr::new(&Either::Left(record_expr)),
- field_list_parent_path,
- missed_fields,
- }
- .into(),
- );
- }
+ Either::Left(ast::Expr::RecordExpr(record_expr))
+ if record_expr.record_expr_field_list().is_some() =>
+ {
+ let field_list_parent_path =
+ record_expr.path().map(|path| AstPtr::new(&path));
+ return Some(
+ MissingFields {
+ file,
+ field_list_parent: AstPtr::new(&Either::Left(record_expr)),
+ field_list_parent_path,
+ missed_fields,
+ }
+ .into(),
+ );
}
- Either::Right(ast::Pat::RecordPat(record_pat)) => {
- if record_pat.record_pat_field_list().is_some() {
- let field_list_parent_path =
- record_pat.path().map(|path| AstPtr::new(&path));
- return Some(
- MissingFields {
- file,
- field_list_parent: AstPtr::new(&Either::Right(record_pat)),
- field_list_parent_path,
- missed_fields,
- }
- .into(),
- );
- }
+ Either::Right(ast::Pat::RecordPat(record_pat))
+ if record_pat.record_pat_field_list().is_some() =>
+ {
+ let field_list_parent_path =
+ record_pat.path().map(|path| AstPtr::new(&path));
+ return Some(
+ MissingFields {
+ file,
+ field_list_parent: AstPtr::new(&Either::Right(record_pat)),
+ field_list_parent_path,
+ missed_fields,
+ }
+ .into(),
+ );
}
_ => {}
}