Introduce 'ast::Pat::is_rest(&self) -> bool'.
This commit is contained in:
parent
f7c75cc11a
commit
ff77ef2d70
1 changed files with 8 additions and 0 deletions
|
|
@ -580,6 +580,14 @@ impl Pat {
|
|||
| PatKind::Mac(_) => true,
|
||||
}
|
||||
}
|
||||
|
||||
/// Is this a `..` pattern?
|
||||
pub fn is_rest(&self) -> bool {
|
||||
match self.node {
|
||||
PatKind::Rest => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A single field in a struct pattern
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue