When I write this and save:
let board = stdin.lock().lines().map(|r| r.unwrap()).take(3).collect::<String>();
It is automatically formatted like this:
let board = stdin
.lock()
.lines()
.map(|r| r.unwrap())
.take(3)
.collect::<String>();
Is there a way to prevent this or at least increase the line length where it begins (75) without disabling autoformatting completely? I've tried changing standard vs code settings for wrapping and rulers but it doesn't affect rls.
Formatting is done by rustfmt. The link also explains how to setup a configuration file where you can disable certain formatting options.
Thanks, I got the desired behavior by creating rustfmt.toml with just a single line:
max_width = 120
Most helpful comment
Thanks, I got the desired behavior by creating
rustfmt.tomlwith just a single line: