mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Cleanup
This commit is contained in:
parent
075fe761f3
commit
42eb4efb5b
7 changed files with 148 additions and 176 deletions
|
@ -796,6 +796,16 @@ impl ast::TokenTree {
|
|||
.into_token()
|
||||
.filter(|it| matches!(it.kind(), T!['}'] | T![')'] | T![']']))
|
||||
}
|
||||
|
||||
pub fn parent_meta(&self) -> Option<ast::Meta> {
|
||||
self.syntax().parent().and_then(ast::Meta::cast)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::Meta {
|
||||
pub fn parent_attr(&self) -> Option<ast::Attr> {
|
||||
self.syntax().parent().and_then(ast::Attr::cast)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::GenericParamList {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue