diff options
author | Aleksey Kladov <[email protected]> | 2019-11-26 14:21:29 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-26 14:44:43 +0000 |
commit | d118997b9318b750676a7fe5b8896219f98d9e6e (patch) | |
tree | 0ec33a8c39d0815d288a575dc4986f8029f5f4d1 /crates/ra_hir/src/code_model.rs | |
parent | 9bc8f1f4f8d7bded19517205f8522a0110204f51 (diff) |
Remove assoc_type_by_name helper
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9e7a1deec..50e6409b1 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -740,10 +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(self, db: &impl DefDatabase, name: &Name) -> Option<TypeAlias> { | ||
744 | db.trait_data(self.id).associated_type_by_name(name).map(TypeAlias::from) | ||
745 | } | ||
746 | |||
747 | pub fn associated_type_by_name_including_super_traits( | 743 | pub fn associated_type_by_name_including_super_traits( |
748 | self, | 744 | self, |
749 | db: &impl HirDatabase, | 745 | db: &impl HirDatabase, |
@@ -751,8 +747,8 @@ impl Trait { | |||
751 | ) -> Option<TypeAlias> { | 747 | ) -> Option<TypeAlias> { |
752 | all_super_traits(db, self.id) | 748 | all_super_traits(db, self.id) |
753 | .into_iter() | 749 | .into_iter() |
754 | .map(Trait::from) | 750 | .find_map(|t| db.trait_data(t).associated_type_by_name(name)) |
755 | .find_map(|t| t.associated_type_by_name(db, name)) | 751 | .map(TypeAlias::from) |
756 | } | 752 | } |
757 | 753 | ||
758 | pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef { | 754 | pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef { |