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

Braceless Else on Braced Expressions #1686

Closed
wants to merge 8 commits into from

Conversation

phoenixenero
Copy link

Make braces around else body optional on single expressions that require braces to increase brevity.

Addresses issue #1616.

} else if bar() {
do_this_other_thing()
} else {
match baz() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often does something like this actually occur?

@nagisa
Copy link
Member

nagisa commented Jul 25, 2016

RFC is missing a section on changes to the grammar.

@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the RFC. label Jul 25, 2016
@nrc
Copy link
Member

nrc commented Jul 25, 2016

I'm not really in favour of any change here, but if we really want something, I'd prefer else match in the spirit of else if/else if let rather than a generic skip the braces rule.

@phoenixenero
Copy link
Author

I'll make a different, more specific proposal then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants