mozilla/rust — pull request #3194 by dbp (2012-08-14 03:02:43+00:00)
Title: Pretty printing brackets on match arms

Currently, the pretty printer prints the brackets for match arms (if they are blocks) on a new line. This means you get something like (omitting a bunch of repetitions to make it not all fit inline):

fn main() {
match h {
something =>
{
hello;
...
hello;
}
}
}

This is because the block is printed with print_expr, which means the whole thing is wrapped inside of a box. What should happen is that the opening bracket should be in the head box with something => (that's how it works elsewhere). With the code in this pull request, the same code is formatted as:

fn main() {
match h {
something => {
hello;
...
hello;
}
}
}

Which seems better.