Skip to content
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

Fix brace_style="PreferSameLine" with trailing_comma="Vertical" results #5895

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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