rspec/rules/S2957/swift/rule.adoc

26 lines
407 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
When a closure contains only a ``++return++`` statement, the ``++return++`` itself can be omitted.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
someList.sort { a, b in
return a > b
}
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
someList.sort { a, b in a > b }
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]