-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use trailing closures for single closure args #307
Comments
a4sriniv
added a commit
that referenced
this issue
Jan 30, 2016
#307: Implement trailing closure rule
How about allowing these statements within the rule:
? |
maybe this one is better ? reversed = names.sort { $0 > $1 } |
Huh? @AntiMoron how it's related to the topic? :) |
Hey @andrew8712, we think its best to keep this rule as it is, it will enforce this as the preferred style: reversedTopTen = names.sort { s1, s2 in return s1 > s2 }.prefix(10)
firstName = names.sort { s1, s2 in return s1 > s2 }.first |
But this style reduces readability, especially when the chain is long. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preferred
Not Preferred
The text was updated successfully, but these errors were encountered: