From 6145234450cc3e8d79c7f4e2105e36ccd96ee3b4 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 3 Nov 2020 20:54:44 +0100 Subject: Support struct variants in extract_struct_from_enum_variant --- crates/ide/src/diagnostics/fixes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ide') diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index 02e17ba43..d275dd75b 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs @@ -157,7 +157,8 @@ fn missing_record_expr_field_fix( return None; } let new_field = make::record_field( - record_expr_field.field_name()?, + None, + make::name(record_expr_field.field_name()?.text()), make::ty(&new_field_type.display_source_code(sema.db, module.into()).ok()?), ); -- cgit v1.2.3