aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers/extract_struct_from_enum_variant.rs')
-rw-r--r--crates/assists/src/handlers/extract_struct_from_enum_variant.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
index 030b9cd0c..6f35a061c 100644
--- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -117,10 +117,14 @@ fn existing_definition(db: &RootDatabase, variant_name: &ast::Name, variant: &Va
117 .into_iter() 117 .into_iter()
118 .filter(|(_, def)| match def { 118 .filter(|(_, def)| match def {
119 // only check type-namespace 119 // only check type-namespace
120 hir::ScopeDef::ModuleDef(def) => matches!(def, 120 hir::ScopeDef::ModuleDef(def) => matches!(
121 ModuleDef::Module(_) | ModuleDef::Adt(_) | 121 def,
122 ModuleDef::Variant(_) | ModuleDef::Trait(_) | 122 ModuleDef::Module(_)
123 ModuleDef::TypeAlias(_) | ModuleDef::BuiltinType(_) 123 | ModuleDef::Adt(_)
124 | ModuleDef::Variant(_)
125 | ModuleDef::Trait(_)
126 | ModuleDef::TypeAlias(_)
127 | ModuleDef::BuiltinType(_)
124 ), 128 ),
125 _ => false, 129 _ => false,
126 }) 130 })