mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Deduplicate some code
This commit is contained in:
parent
bb0de88f24
commit
2ebf0c87c2
22 changed files with 299 additions and 234 deletions
|
@ -61,7 +61,7 @@ pub(crate) fn goto_declaration(
|
|||
_ => None,
|
||||
}?;
|
||||
|
||||
let trait_ = assoc.containing_trait_impl(db)?;
|
||||
let trait_ = assoc.implemented_trait(db)?;
|
||||
let name = Some(assoc.name(db)?);
|
||||
let item = trait_.items(db).into_iter().find(|it| it.name(db) == name)?;
|
||||
item.try_to_nav(db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue