add guard pattern AST node
This commit is contained in:
parent
35bbc45f16
commit
9b8bfed73b
7 changed files with 26 additions and 4 deletions
|
@ -1709,6 +1709,12 @@ impl<'a> State<'a> {
|
|||
self.print_expr(e, FixupContext::default());
|
||||
}
|
||||
}
|
||||
PatKind::Guard(subpat, condition) => {
|
||||
self.print_pat(subpat);
|
||||
self.space();
|
||||
self.word_space("if");
|
||||
self.print_expr(condition, FixupContext::default());
|
||||
}
|
||||
PatKind::Slice(elts) => {
|
||||
self.word("[");
|
||||
self.commasep(Inconsistent, elts, |s, p| s.print_pat(p));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue