mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
use Source for TypeAlias
This commit is contained in:
parent
647c8f3df8
commit
f2ccc54468
7 changed files with 22 additions and 38 deletions
|
@ -932,12 +932,19 @@ pub struct TypeAlias {
|
|||
pub(crate) id: TypeAliasId,
|
||||
}
|
||||
|
||||
impl HasSource for TypeAlias {
|
||||
type Ast = TreeArc<ast::TypeAliasDef>;
|
||||
fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::TypeAliasDef>> {
|
||||
self.id.source(db).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeAlias {
|
||||
pub fn source(
|
||||
self,
|
||||
db: &(impl DefDatabase + AstDatabase),
|
||||
) -> (HirFileId, TreeArc<ast::TypeAliasDef>) {
|
||||
self.id.source(db)
|
||||
) -> Source<TreeArc<ast::TypeAliasDef>> {
|
||||
self.id.source(db).into()
|
||||
}
|
||||
|
||||
pub fn module(self, db: &impl DefDatabase) -> Module {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue