rspec/rules/S1301/swift/rule.adoc

38 lines
519 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
switch (variable) {
case 0:
doSomething();
default:
doSomethingElse();
}
----
== Compliant Solution
----
if (variable == 0) {
doSomething();
} else {
doSomethingElse();
}
----
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[]