diff options
Diffstat (limited to 'crates/ide/src/goto_implementation.rs')
-rw-r--r-- | crates/ide/src/goto_implementation.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs index 43356a94e..0013820b4 100644 --- a/crates/ide/src/goto_implementation.rs +++ b/crates/ide/src/goto_implementation.rs | |||
@@ -52,13 +52,13 @@ pub(crate) fn goto_implementation( | |||
52 | hir::ModuleDef::Function(f) => { | 52 | hir::ModuleDef::Function(f) => { |
53 | let assoc = f.as_assoc_item(sema.db)?; | 53 | let assoc = f.as_assoc_item(sema.db)?; |
54 | let name = assoc.name(sema.db)?; | 54 | let name = assoc.name(sema.db)?; |
55 | let trait_ = assoc.containing_trait(sema.db)?; | 55 | let trait_ = assoc.containing_trait_or_trait_impl(sema.db)?; |
56 | impls_for_trait_item(&sema, trait_, name) | 56 | impls_for_trait_item(&sema, trait_, name) |
57 | } | 57 | } |
58 | hir::ModuleDef::Const(c) => { | 58 | hir::ModuleDef::Const(c) => { |
59 | let assoc = c.as_assoc_item(sema.db)?; | 59 | let assoc = c.as_assoc_item(sema.db)?; |
60 | let name = assoc.name(sema.db)?; | 60 | let name = assoc.name(sema.db)?; |
61 | let trait_ = assoc.containing_trait(sema.db)?; | 61 | let trait_ = assoc.containing_trait_or_trait_impl(sema.db)?; |
62 | impls_for_trait_item(&sema, trait_, name) | 62 | impls_for_trait_item(&sema, trait_, name) |
63 | } | 63 | } |
64 | _ => return None, | 64 | _ => return None, |
@@ -87,7 +87,7 @@ fn impls_for_trait_item( | |||
87 | .filter_map(|imp| { | 87 | .filter_map(|imp| { |
88 | let item = imp.items(sema.db).iter().find_map(|itm| { | 88 | let item = imp.items(sema.db).iter().find_map(|itm| { |
89 | let itm_name = itm.name(sema.db)?; | 89 | let itm_name = itm.name(sema.db)?; |
90 | (itm_name == fun_name).then(|| itm.clone()) | 90 | (itm_name == fun_name).then(|| *itm) |
91 | })?; | 91 | })?; |
92 | item.try_to_nav(sema.db) | 92 | item.try_to_nav(sema.db) |
93 | }) | 93 | }) |