
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
49 lines
1.0 KiB
Plaintext
49 lines
1.0 KiB
Plaintext
== Why is this an issue?
|
|
|
|
When a closure contains only a ``++return++`` statement, the ``++return++`` itself can be omitted.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,swift]
|
|
----
|
|
someList.sort { a, b in
|
|
return a > b
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,swift]
|
|
----
|
|
someList.sort { a, b in a > b }
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove the "return" keyword.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 20 May 2015, 18:13:45 Ann Campbell wrote:
|
|
\[~elena.vilchik] I suspect a standard "for greater readability" argument is expected here, but it's hard for me to make it. Feel free to add it yourself. :-)
|
|
|
|
=== on 21 May 2015, 07:13:19 Elena Vilchik wrote:
|
|
\[~ann.campbell.2] what do you mean "argument"? Anyway I looks good to me now :)
|
|
|
|
=== on 3 Feb 2016, 17:11:53 Ann Campbell wrote:
|
|
\[~elena.vilchik] I just now saw your response (doh!). In this case "argument" == "reason".
|
|
|
|
endif::env-github,rspecator-view[]
|