diff options
Diffstat (limited to 'crates/ra_ide_api/src/impls.rs')
-rw-r--r-- | crates/ra_ide_api/src/impls.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide_api/src/impls.rs index b899ed3a5..bc9b66550 100644 --- a/crates/ra_ide_api/src/impls.rs +++ b/crates/ra_ide_api/src/impls.rs | |||
@@ -4,7 +4,7 @@ use hir::{db::HirDatabase, ApplicationTy, FromSource, Ty, TypeCtor}; | |||
4 | use ra_db::SourceDatabase; | 4 | use ra_db::SourceDatabase; |
5 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; | 5 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; |
6 | 6 | ||
7 | use crate::{db::RootDatabase, FilePosition, NavigationTarget, RangeInfo}; | 7 | use crate::{db::RootDatabase, display::ToNav, FilePosition, NavigationTarget, RangeInfo}; |
8 | 8 | ||
9 | pub(crate) fn goto_implementation( | 9 | pub(crate) fn goto_implementation( |
10 | db: &RootDatabase, | 10 | db: &RootDatabase, |
@@ -58,7 +58,7 @@ fn impls_for_def( | |||
58 | impls | 58 | impls |
59 | .all_impls() | 59 | .all_impls() |
60 | .filter(|impl_block| is_equal_for_find_impls(&ty, &impl_block.target_ty(db))) | 60 | .filter(|impl_block| is_equal_for_find_impls(&ty, &impl_block.target_ty(db))) |
61 | .map(|imp| NavigationTarget::from_impl_block(db, imp)) | 61 | .map(|imp| imp.to_nav(db)) |
62 | .collect(), | 62 | .collect(), |
63 | ) | 63 | ) |
64 | } | 64 | } |
@@ -75,12 +75,7 @@ fn impls_for_trait( | |||
75 | let krate = module.krate(); | 75 | let krate = module.krate(); |
76 | let impls = db.impls_in_crate(krate); | 76 | let impls = db.impls_in_crate(krate); |
77 | 77 | ||
78 | Some( | 78 | Some(impls.lookup_impl_blocks_for_trait(tr).map(|imp| imp.to_nav(db)).collect()) |
79 | impls | ||
80 | .lookup_impl_blocks_for_trait(tr) | ||
81 | .map(|imp| NavigationTarget::from_impl_block(db, imp)) | ||
82 | .collect(), | ||
83 | ) | ||
84 | } | 79 | } |
85 | 80 | ||
86 | fn is_equal_for_find_impls(original_ty: &Ty, impl_ty: &Ty) -> bool { | 81 | fn is_equal_for_find_impls(original_ty: &Ty, impl_ty: &Ty) -> bool { |