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
|
@ -182,11 +182,7 @@ fn try_filter_trait_item_definition(
|
|||
match assoc {
|
||||
AssocItem::Function(..) => None,
|
||||
AssocItem::Const(..) | AssocItem::TypeAlias(..) => {
|
||||
let imp = match assoc.container(db) {
|
||||
hir::AssocItemContainer::Impl(imp) => imp,
|
||||
_ => return None,
|
||||
};
|
||||
let trait_ = imp.trait_(db)?;
|
||||
let trait_ = assoc.implemented_trait(db)?;
|
||||
let name = def.name(db)?;
|
||||
let discri_value = discriminant(&assoc);
|
||||
trait_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue