mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
TypeParamList Owner
This commit is contained in:
parent
55896aedb1
commit
8e3bec11eb
5 changed files with 118 additions and 26 deletions
|
@ -24,6 +24,22 @@ pub trait NameOwner<'a>: AstNode<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait TypeParamsOwner<'a>: AstNode<'a> {
|
||||
fn type_param_list(self) -> Option<TypeParamList<'a>> {
|
||||
self.syntax()
|
||||
.children()
|
||||
.filter_map(TypeParamList::cast)
|
||||
.next()
|
||||
}
|
||||
|
||||
fn where_clause(self) -> Option<WhereClause<'a>> {
|
||||
self.syntax()
|
||||
.children()
|
||||
.filter_map(WhereClause::cast)
|
||||
.next()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AttrsOwner<'a>: AstNode<'a> {
|
||||
fn attrs(&self) -> Box<Iterator<Item=Attr<'a>> + 'a> {
|
||||
let it = self.syntax().children()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue