rspec/rules/S2957/swift/rule.adoc

19 lines
250 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 }
----