Skip to content

Conversation

@gentoid
Copy link
Contributor

@gentoid gentoid commented Aug 27, 2023

Fixes #2321

  • Fixed trailing comma did not disappear when configured brace_style="PreferSameLine" and trailing_comma="Vertical".
  • Fixed test case.

Example

When brace_style="PreferSameLine" and trailing_comma="Vertical" configured, the results would be as in the following example:

before

fn lorem<S, T>(lorem: S, ipsum: T)
where
    S: Add + Sub,
    T: Mul + Div, { // ← trailing comma is not removed from the bound
    // body
}

after

fn lorem<S, T>(lorem: S, ipsum: T)
where
    S: Add + Sub,
    T: Mul + Div {
    // body
}

NOTE

This is continuation of a PR #5556, which seems to be abandoned. All the credits go to @hirasawayuki . I'll adjust the code if need be. For now, I only synched the branch with master.

@gentoid gentoid marked this pull request as ready for review August 27, 2023 12:03
@calebcartwright
Copy link
Member

Thanks for the PR!

@ytmimi I know you've a lot on your plate already, but was wondering if you'd want to review this one given you were pretty engaged with it back on #5556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PreferSameLine brace_style with trailing_comma Vertical produces weird results

4 participants