mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
support ref-patterns
This commit is contained in:
parent
40686722ba
commit
8e554ea5fa
5 changed files with 46 additions and 11 deletions
|
@ -348,6 +348,12 @@ impl UseTreeList {
|
|||
}
|
||||
}
|
||||
|
||||
impl RefPat {
|
||||
pub fn is_mut(&self) -> bool {
|
||||
self.syntax().children().any(|n| n.kind() == MUT_KW)
|
||||
}
|
||||
}
|
||||
|
||||
fn child_opt<P: AstNode, C: AstNode>(parent: &P) -> Option<&C> {
|
||||
children(parent).next()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue