Skip to content

Grouping match arms #490

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

Closed
nrc opened this issue Oct 18, 2015 · 1 comment
Closed

Grouping match arms #490

nrc opened this issue Oct 18, 2015 · 1 comment
Labels
a-matches match arms, patterns, blocks, etc p-low poor-formatting

Comments

@nrc
Copy link
Member

nrc commented Oct 18, 2015

If there are groups of patterns in a match arm, we should ensure there is either indentation or a blank line between groups. This is a bit tricky because for simple matches we don't want to insert a bunch of newlines.

e.g.,

            ExprKind::Index { .. } |
            ExprKind::SelfRef |
            ExprKind::VarRef { .. } |
            ExprKind::StaticRef { .. } => Some(Category::Lvalue),

            ExprKind::Index { .. } |
            ExprKind::SelfRef |
            ExprKind::VarRef { .. } |
            ExprKind::StaticRef { .. } => Some(Category::Lvalue),

but also

            ExprKind::Index { .. } => Some(Category::Lvalue),
            ExprKind::SelfRef => Some(Category::Lvalue),
            ExprKind::VarRef { .. } => Some(Category::Lvalue),
            ExprKind::StaticRef { .. } => Some(Category::Lvalue),
@calebcartwright
Copy link
Member

Closing as this was implemented some time ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-matches match arms, patterns, blocks, etc p-low poor-formatting
Projects
None yet
Development

No branches or pull requests

2 participants