diff options
author | Aleksey Kladov <[email protected]> | 2019-11-27 09:31:40 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-27 09:34:26 +0000 |
commit | 825049bc6247f6d596910cd99f76f891d5435a86 (patch) | |
tree | 24e9543a78e13477a85c38f98a58f402d7a40ef9 /crates/ra_hir_def | |
parent | e91ebfc752bdfa8fc20be6ea97a14aa6a4d897ae (diff) |
Decouple
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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!( | |||
398 | ConstId | 398 | ConstId |
399 | ); | 399 | ); |
400 | 400 | ||
401 | impl From<AssocItemId> for GenericDefId { | ||
402 | fn from(item: AssocItemId) -> Self { | ||
403 | match item { | ||
404 | AssocItemId::FunctionId(f) => f.into(), | ||
405 | AssocItemId::ConstId(c) => c.into(), | ||
406 | AssocItemId::TypeAliasId(t) => t.into(), | ||
407 | } | ||
408 | } | ||
409 | } | ||
410 | |||
401 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 411 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
402 | pub enum AttrDefId { | 412 | pub enum AttrDefId { |
403 | ModuleId(ModuleId), | 413 | ModuleId(ModuleId), |