aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-21 09:21:46 +0000
committerAleksey Kladov <[email protected]>2019-11-21 10:25:03 +0000
commit0102fb41337ac0442e689d410bb424d215e9a7bd (patch)
treec77bf501427adc77c0fc92fe75fd9f314087b120 /crates/ra_hir_def
parent612a72fc4ea4376920f2a7da7b3c334227c1716c (diff)
Decouple Resolver
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/traits.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/traits.rs b/crates/ra_hir_def/src/traits.rs
index 877d73d66..6c2d5b2a9 100644
--- a/crates/ra_hir_def/src/traits.rs
+++ b/crates/ra_hir_def/src/traits.rs
@@ -11,7 +11,7 @@ use ra_syntax::ast::{self, NameOwner};
11 11
12use crate::{ 12use crate::{
13 db::DefDatabase2, AssocItemId, AstItemDef, ConstLoc, ContainerId, FunctionLoc, Intern, TraitId, 13 db::DefDatabase2, AssocItemId, AstItemDef, ConstLoc, ContainerId, FunctionLoc, Intern, TraitId,
14 TypeAliasLoc, 14 TypeAliasId, TypeAliasLoc,
15}; 15};
16 16
17#[derive(Debug, Clone, PartialEq, Eq)] 17#[derive(Debug, Clone, PartialEq, Eq)]
@@ -56,4 +56,11 @@ impl TraitData {
56 }; 56 };
57 Arc::new(TraitData { name, items, auto }) 57 Arc::new(TraitData { name, items, auto })
58 } 58 }
59
60 pub fn associated_types(&self) -> impl Iterator<Item = TypeAliasId> + '_ {
61 self.items.iter().filter_map(|item| match item {
62 AssocItemId::TypeAliasId(t) => Some(*t),
63 _ => None,
64 })
65 }
59} 66}