From 609680ef97dbf82c07b6b06e21aa366423892304 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:52:53 +0200 Subject: Rename EnumDef -> Enum --- crates/ra_hir/src/has_source.rs | 4 ++-- crates/ra_hir/src/semantics.rs | 2 +- crates/ra_hir/src/semantics/source_to_def.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 811a12e00..88399f724 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs @@ -69,8 +69,8 @@ impl HasSource for Union { } } impl HasSource for Enum { - type Ast = ast::EnumDef; - fn source(self, db: &dyn HirDatabase) -> InFile { + type Ast = ast::Enum; + fn source(self, db: &dyn HirDatabase) -> InFile { self.id.lookup(db.upcast()).source(db.upcast()) } } diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 7df018b05..f8e70fe27 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -581,7 +581,7 @@ macro_rules! to_def_impls { to_def_impls![ (crate::Module, ast::Module, module_to_def), (crate::Struct, ast::Struct, struct_to_def), - (crate::Enum, ast::EnumDef, enum_to_def), + (crate::Enum, ast::Enum, enum_to_def), (crate::Union, ast::Union, union_to_def), (crate::Trait, ast::TraitDef, trait_to_def), (crate::ImplDef, ast::ImplDef, impl_to_def), diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 75b773352..9f81b952f 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -77,7 +77,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn struct_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::STRUCT) } - pub(super) fn enum_to_def(&mut self, src: InFile) -> Option { + pub(super) fn enum_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::ENUM) } pub(super) fn union_to_def(&mut self, src: InFile) -> Option { @@ -170,7 +170,7 @@ impl SourceToDefCtx<'_, '_> { let def = self.struct_to_def(container.with_value(it))?; VariantId::from(def).into() }, - ast::EnumDef(it) => { + ast::Enum(it) => { let def = self.enum_to_def(container.with_value(it))?; def.into() }, @@ -206,7 +206,7 @@ impl SourceToDefCtx<'_, '_> { match (container.value) { ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), ast::Struct(it) => self.struct_to_def(container.with_value(it))?.into(), - ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), + ast::Enum(it) => self.enum_to_def(container.with_value(it))?.into(), ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), -- cgit v1.2.3