rspec/rules/S2758/swift/rule.adoc

37 lines
625 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,swift]
----
func canVote(person:Person) -> Bool {
return person.age > 18 ? true : true // Noncompliant; is this what was intended?
}
----
=== Compliant solution
[source,swift]
----
func canVote(person:Person) -> Bool {
return person.age > 18 ? true : false
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]