From 825049bc6247f6d596910cd99f76f891d5435a86 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 27 Nov 2019 12:31:40 +0300 Subject: Decouple --- crates/ra_hir_def/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 274dd1467..ea3f00bb3 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs @@ -398,6 +398,16 @@ impl_froms!( ConstId ); +impl From for GenericDefId { + fn from(item: AssocItemId) -> Self { + match item { + AssocItemId::FunctionId(f) => f.into(), + AssocItemId::ConstId(c) => c.into(), + AssocItemId::TypeAliasId(t) => t.into(), + } + } +} + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum AttrDefId { ModuleId(ModuleId), -- cgit v1.2.3