-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stabilise fn_args_density #3581
Conversation
fn_args_density
passes the conditions to be made stable.
Seems reasonable to me. My concern is its name, |
@topecongiro Actually sounds good to me! It reminds me of css flex so using a similar term gives a good idea of what the option does. |
@scampi Looks good!
|
Yes, that's the price of an unstable option. If it were stable, that'd be a totally different story! |
@topecongiro it has been renamed in the latest commit |
It keeps on failing with the error below, but locally it builds fine:
|
unnecessary condition
The density parameter of items::rewrite_where_clause was used only in a conditional, which evaluated to true only if the parameter was Density::Tall.
Thank you for the updates! |
@topecongiro How soon before we could see this in a release? |
Also update the rustfmt option fn_args_density to fn_args_layout. See rust-lang/rustfmt#3581. type_alias_enum_variants is apparently now in stable, so there's no need to require it as a feature.
See rust-lang/rustfmt#3581 for background.
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background.
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
I think
fn_args_density
passes the conditions to be made stable.Tall
is the best compromise for formatting arguments by default:An enum
Density
is used so it is easy to add a new kind of density later if needed without breaking backward compatibility. That enum is mapped internally to another enum calledListTactic
, the core logic is limited to the functionlists::definitive_tactic
which looks clear.The enum
Density
is used to rewritewhere
clauses which should probably be decoupled. However, this doesn't prevent stabilisation: it looks like it can be replaced straightforwardly by a boolean though:Plenty of time passed with rustfmt being released with that option, giving it plenty of real usage:
Vertical
variant got added 3 years ago db9d129Compressed
andTall
were added 4 years ago 89cda8dIn that time frame, it got only 19 issues showing its implementation is quite stable.
Also, there are few tests about all 3 variants of
Density
:None.
Close #3375