Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs26
1 files changed, 12 insertions, 14 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 633fe1f86b..f9d28ea3b4 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -781,20 +781,18 @@ impl Module {
let (variants, diagnostics) = e.id.enum_variants_with_diagnostics(db);
let file = e.id.lookup(db).id.file_id;
let ast_id_map = db.ast_id_map(file);
- if let Some(diagnostics) = &diagnostics {
- for diag in diagnostics.iter() {
- acc.push(
- InactiveCode {
- node: InFile::new(
- file,
- ast_id_map.get(diag.ast_id).syntax_node_ptr(),
- ),
- cfg: diag.cfg.clone(),
- opts: diag.opts.clone(),
- }
- .into(),
- );
- }
+ for diag in diagnostics {
+ acc.push(
+ InactiveCode {
+ node: InFile::new(
+ file,
+ ast_id_map.get(diag.ast_id).syntax_node_ptr(),
+ ),
+ cfg: diag.cfg.clone(),
+ opts: diag.opts.clone(),
+ }
+ .into(),
+ );
}
for &(v, _) in variants.variants.values() {
let source_map = &v.fields_with_source_map(db).1;