-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Labels
Milestone
Description
rustfmt 0.99.2-nightly (5c9a2b6 2018-08-07)
Input like:
fn foo() {
a.first().second().third().fourth(|| { let a = 1; }).fifth(some_argument).sixth("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
}
is left completely untouched due to being unable to fit the long argument, even in the presence of patterns that must be broken into multiple lines (|| { let a = 1; }
in this case). I'd expect rustfmt to do the best it can even if that means leaving some lines overflowing (which would be better than not doing anything), for instance like this:
fn foo() {
a.first()
.second()
.third()
.fourth(|| {
let a = 1;
}).fifth(some_argument)
.sixth(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
);
}
msrd0, mvolfik, tylerlaprade and tv42