mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Refactor to unify with method resolution
This commit is contained in:
parent
c7cedea270
commit
1173c3dab5
7 changed files with 117 additions and 141 deletions
|
@ -1053,4 +1053,13 @@ impl AssocItem {
|
|||
AssocItem::TypeAlias(t) => t.module(db),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn container(self, db: &impl DefDatabase) -> Container {
|
||||
match self {
|
||||
AssocItem::Function(f) => f.container(db),
|
||||
AssocItem::Const(c) => c.container(db),
|
||||
AssocItem::TypeAlias(t) => t.container(db),
|
||||
}
|
||||
.expect("AssocItem without container")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue