mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Deduplicate some code
This commit is contained in:
parent
bb0de88f24
commit
2ebf0c87c2
22 changed files with 299 additions and 234 deletions
|
@ -206,7 +206,7 @@ impl Definition {
|
|||
// docs are missing, for assoc items of trait impls try to fall back to the docs of the
|
||||
// original item of the trait
|
||||
let assoc = self.as_assoc_item(db)?;
|
||||
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.docs(db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue