rustfmt
rustfmt copied to clipboard
Ignoring empty statements in closures.
Solve #6116
@rscprof Thanks again for your help on this. I've taken another look at this PR and there's another test case that I'd like to see if we can resolve before merging.
Given the following input:
fn foo() -> fn(i32) -> i32 {
|x| {
/*comment before empty statement */;/*comment between statements */;
x
}
}
it formats as
fn foo() -> fn(i32) -> i32 {
|x| {
/*comment before empty statement */ /*comment between statements */
x
}
}
running rustfmt again formats as
fn foo() -> fn(i32) -> i32 {
|x| {
/*comment before empty statement */
/*comment between statements */
x
}
}
and running rustfmt once again stabilizes as:
fn foo() -> fn(i32) -> i32 {
|x| {
/*comment before empty statement */
/*comment between statements */
x
}
}