aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-20 14:49:57 +0000
committerAleksey Kladov <[email protected]>2019-11-20 14:50:02 +0000
commitee95a35664e6fe9153f6324cfc57872ca365887c (patch)
tree3f13501f0e73fee374a0df05fb55614311559f15 /crates/ra_hir
parent64c21ed19594b323e72605ba8c5dd4c6eee433f6 (diff)
Don't duplicate ContainerId type
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index b8d48a500..669666989 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -12,8 +12,8 @@ use hir_def::{
12 builtin_type::BuiltinType, 12 builtin_type::BuiltinType,
13 traits::TraitData, 13 traits::TraitData,
14 type_ref::{Mutability, TypeRef}, 14 type_ref::{Mutability, TypeRef},
15 AssocItemId, CrateModuleId, FunctionContainerId, HasModule, ImplId, LocalEnumVariantId, 15 AssocItemId, ContainerId, CrateModuleId, HasModule, ImplId, LocalEnumVariantId,
16 LocalStructFieldId, Lookup, ModuleId, TypeAliasContainerId, UnionId, 16 LocalStructFieldId, Lookup, ModuleId, UnionId,
17}; 17};
18use hir_expand::{ 18use hir_expand::{
19 diagnostics::DiagnosticSink, 19 diagnostics::DiagnosticSink,
@@ -697,9 +697,9 @@ impl Function {
697 697
698 pub fn container(self, db: &impl DefDatabase) -> Option<Container> { 698 pub fn container(self, db: &impl DefDatabase) -> Option<Container> {
699 match self.id.lookup(db).container { 699 match self.id.lookup(db).container {
700 FunctionContainerId::TraitId(it) => Some(Container::Trait(it.into())), 700 ContainerId::TraitId(it) => Some(Container::Trait(it.into())),
701 FunctionContainerId::ImplId(it) => Some(Container::ImplBlock(it.into())), 701 ContainerId::ImplId(it) => Some(Container::ImplBlock(it.into())),
702 FunctionContainerId::ModuleId(_) => None, 702 ContainerId::ModuleId(_) => None,
703 } 703 }
704 } 704 }
705 705
@@ -979,9 +979,9 @@ impl TypeAlias {
979 979
980 pub fn container(self, db: &impl DefDatabase) -> Option<Container> { 980 pub fn container(self, db: &impl DefDatabase) -> Option<Container> {
981 match self.id.lookup(db).container { 981 match self.id.lookup(db).container {
982 TypeAliasContainerId::TraitId(it) => Some(Container::Trait(it.into())), 982 ContainerId::TraitId(it) => Some(Container::Trait(it.into())),
983 TypeAliasContainerId::ImplId(it) => Some(Container::ImplBlock(it.into())), 983 ContainerId::ImplId(it) => Some(Container::ImplBlock(it.into())),
984 TypeAliasContainerId::ModuleId(_) => None, 984 ContainerId::ModuleId(_) => None,
985 } 985 }
986 } 986 }
987 987