From 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:50:40 +0200 Subject: Rename StructDef -> Struct --- 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 3a3d82109..811a12e00 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs @@ -57,8 +57,8 @@ impl HasSource for Field { } } impl HasSource for Struct { - type Ast = ast::StructDef; - fn source(self, db: &dyn HirDatabase) -> InFile { + type Ast = ast::Struct; + 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 6c8775402..7df018b05 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -580,7 +580,7 @@ macro_rules! to_def_impls { to_def_impls![ (crate::Module, ast::Module, module_to_def), - (crate::Struct, ast::StructDef, struct_to_def), + (crate::Struct, ast::Struct, struct_to_def), (crate::Enum, ast::EnumDef, enum_to_def), (crate::Union, ast::Union, union_to_def), (crate::Trait, ast::TraitDef, trait_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 0093a8671..75b773352 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -74,7 +74,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn fn_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::FUNCTION) } - pub(super) fn struct_to_def(&mut self, src: InFile) -> Option { + 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 { @@ -166,7 +166,7 @@ impl SourceToDefCtx<'_, '_> { let def = self.fn_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, - ast::StructDef(it) => { + ast::Struct(it) => { let def = self.struct_to_def(container.with_value(it))?; VariantId::from(def).into() }, @@ -205,7 +205,7 @@ impl SourceToDefCtx<'_, '_> { let res: GenericDefId = match_ast! { match (container.value) { ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), - ast::StructDef(it) => self.struct_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::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), -- cgit v1.2.3