News for hackers. Stuff that matters.
Re:First Impressions of Rust by qchris on Friday August 07, 2020 @01:49AM (#24078778)
Just in case anyone's not familiar with it, I figured it's worth pointing that rustfmt is also really customizable, using a `rustfmt.toml` file in the source directory. It might take a little time to get right, but it's not as if you're stuck with the default options, and a .toml file is pretty easy to play around with.

[1] https://rust-lang.github.io/rustfmt/?version=master&search=

Re:First Impressions of Rust by ssokolow on Friday August 07, 2020 @04:19AM (#24079613)
Unfortunately, `rustfmt.toml` isn't expressive enough, even on nightly.

I've had to make use of `rustfmt::skip` in various places to keep it from doing things like mangling the groupings and explanatory comments in `const` arrays or making code gratuitously tall and thin.

...and that sometimes means either `git gui` cherry-picking and only running rustfmt infrequently or applying `rustfmt::skip` too broadly because of errors like "error[E0658]: attributes on expressions are experimental"

(I'm in the process of migrating from cherry-picking to over-broad `rustfmt::skip` so I can use format-on-save.)