1
Fork 0

Remove hir::Guard

Use Expr instead. Use `ExprKind::Let` to represent if let guards.
This commit is contained in:
Matthew Jasper 2023-09-21 11:26:50 +00:00
parent 5113ed28ea
commit 407cb24142
17 changed files with 77 additions and 109 deletions

View file

@ -1874,17 +1874,9 @@ impl<'a> State<'a> {
self.print_pat(arm.pat);
self.space();
if let Some(ref g) = arm.guard {
match *g {
hir::Guard::If(e) => {
self.word_space("if");
self.print_expr(e);
self.space();
}
hir::Guard::IfLet(&hir::Let { pat, ty, init, .. }) => {
self.word_nbsp("if");
self.print_let(pat, ty, init);
}
}
self.word_space("if");
self.print_expr(g);
self.space();
}
self.word_space("=>");