diff options
author | Seivan Heidari <[email protected]> | 2019-11-11 13:31:09 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-11 13:31:09 +0000 |
commit | 68a5ff050faf514e9d122212a66703ca8ce66ab7 (patch) | |
tree | 0c389d2680aae82c1805a52f8315312724134341 /crates/ra_ide_api/src/impls.rs | |
parent | 7cd075ff0beb97039cd1d1c6c021abf89339731b (diff) | |
parent | a599147b4232c0d4f6b071a3a96e86f903f4cf52 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
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 { |