rustfmt
rustfmt copied to clipboard
Formatting of "block" macros in let assignments
I call some macros with curly braces and pretend they are blocks. In let assignments, rustfmt turns these macros from
fn main() {
let x = {
a();
b();
c()
};
let y = something!{
a();
b();
c()
};
}
into
fn main() {
let x = {
a();
b();
c()
};
let y =
something!{
a();
b();
c()
};
}
I think it would look better if the macro names were kept on the same line as the let statement, similar to the formatting of real code blocks.
Here's a Playground link of the above example.
Could you tell us which version you are using please? I think this is fixed on the latest rustfmt-nightly.
Oh wow, that's embarrassing. I thought I was running rustfmt from git, but it was just the latest published version on crates.io. Current master branch has this issue fixed. Sorry for wasting your time.