syntax: make match arms store the expr directly.

Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an
`ast::Block` (for historical reasons, AIUI), so we might as just store
that expr directly.

Closes #3085.
This commit is contained in:
Huon Wilson
2014-03-03 18:41:47 +11:00
parent 3f3425a555
commit c3b9047040
15 changed files with 30 additions and 57 deletions

View File

@@ -117,7 +117,7 @@ pub trait Folder {
Arm {
pats: a.pats.map(|x| self.fold_pat(*x)),
guard: a.guard.map(|x| self.fold_expr(x)),
body: self.fold_block(a.body),
body: self.fold_expr(a.body),
}
}
@@ -933,4 +933,3 @@ mod test {
~"zz!zz((zz$zz:zz$(zz $zz:zz)zz+=>(zz$(zz$zz$zz)+)))");
}
}