rspec/rules/S2758/swift/rule.adoc

18 lines
309 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
func canVote(person:Person) -> Bool {
return person.age > 18 ? true : true // Noncompliant; is this what was intended?
}
----
== Compliant Solution
----
func canVote(person:Person) -> Bool {
return person.age > 18 ? true : false
}
----