Introduce 'ast::Pat::is_rest(&self) -> bool'.

This commit is contained in:
Mazdak Farrokhzad 2019-07-09 09:26:11 +02:00
parent f7c75cc11a
commit ff77ef2d70

View File

@ -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