mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
Introduce 'ast::Pat::is_rest(&self) -> bool'.
This commit is contained in:
@@ -580,6 +580,14 @@ pub fn walk<F>(&self, it: &mut F) -> bool
|
||||
| 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
|
||||
|
||||
Reference in New Issue
Block a user