Skip to content

Include trailing comma in single param vertical fn#6890

Open
jasonaowen wants to merge 1 commit into
rust-lang:mainfrom
jasonaowen:fn_params_layout-vertical-single-arg-trailing-comma
Open

Include trailing comma in single param vertical fn#6890
jasonaowen wants to merge 1 commit into
rust-lang:mainfrom
jasonaowen:fn_params_layout-vertical-single-arg-trailing-comma

Conversation

@jasonaowen
Copy link
Copy Markdown

When formatting a function with a single parameter with fn_params_layout set to Vertical, the previous tactic would remove any trailing commas before spilling to multiple lines for other reasons, such as long function names or return types. Instead, use the same tactic as Tall does, so that the trailing comma is kept if the end result spans multiple lines.

Resolves #6889 fn_params_layout = "Vertical" removes single argument's trailing comma

When formatting a function with a single parameter with
`fn_params_layout` set to `Vertical`, the previous tactic would remove
any trailing commas before spilling to multiple lines for other reasons,
such as long function names or return types. Instead, use the same
tactic as `Tall` does, so that the trailing comma is kept if the end
result spans multiple lines.

Issue rust-lang#6889 `fn_params_layout = "Vertical"` removes single argument's
            trailing comma
@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fn_params_layout = "Vertical" removes single argument's trailing comma

2 participants