diff options
author | Aleksey Kladov <[email protected]> | 2019-11-26 14:42:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-26 14:45:06 +0000 |
commit | 24b1e79af51f5af76047a5eee2fe90baf100afca (patch) | |
tree | 4d6767c90e5ac4ec5d6f6149e434ebf09dfa82be /crates/ra_hir/src/code_model.rs | |
parent | 25b32f9d68e9f01f2b92801f4b35daf2b8b250f7 (diff) |
Remove another helper
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 50e6409b1..9578c20b0 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -28,8 +28,8 @@ use crate::{ | |||
28 | expr::{BindingAnnotation, Body, BodySourceMap, ExprValidator, Pat, PatId}, | 28 | expr::{BindingAnnotation, Body, BodySourceMap, ExprValidator, Pat, PatId}, |
29 | ty::display::HirFormatter, | 29 | ty::display::HirFormatter, |
30 | ty::{ | 30 | ty::{ |
31 | self, utils::all_super_traits, InEnvironment, InferenceResult, Namespace, TraitEnvironment, | 31 | self, InEnvironment, InferenceResult, Namespace, TraitEnvironment, TraitRef, Ty, TypeCtor, |
32 | TraitRef, Ty, TypeCtor, TypeWalk, | 32 | TypeWalk, |
33 | }, | 33 | }, |
34 | CallableDef, Either, HirDisplay, Name, Source, | 34 | CallableDef, Either, HirDisplay, Name, Source, |
35 | }; | 35 | }; |
@@ -740,17 +740,6 @@ impl Trait { | |||
740 | db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect() | 740 | db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect() |
741 | } | 741 | } |
742 | 742 | ||
743 | pub fn associated_type_by_name_including_super_traits( | ||
744 | self, | ||
745 | db: &impl HirDatabase, | ||
746 | name: &Name, | ||
747 | ) -> Option<TypeAlias> { | ||
748 | all_super_traits(db, self.id) | ||
749 | .into_iter() | ||
750 | .find_map(|t| db.trait_data(t).associated_type_by_name(name)) | ||
751 | .map(TypeAlias::from) | ||
752 | } | ||
753 | |||
754 | pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef { | 743 | pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef { |
755 | TraitRef::for_trait(db, self) | 744 | TraitRef::for_trait(db, self) |
756 | } | 745 | } |