rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
5.98k stars 878 forks source link

Add option to avoid line break after the `=` in `let` statements #6171

Open larry0x opened 4 months ago

larry0x commented 4 months ago
// suppose this exceeds max line width...
let value = my_function(param1, param2, param3, param4, param5);

// option 1
let value =
    my_function(param1, param2, param3, param4, param5);

// option 2
let value = my_function(
    param1,
    param2,
    param3,
    param4,
    param5,
);

In my opinion, option 1 is very ugly. Would be great if a new config option is added that enforces option 2.

larry0x commented 4 months ago

Seems related: https://github.com/rust-lang/rustfmt/issues/3514