rspec/rules/S1301/swift/rule.adoc

30 lines
399 B
Plaintext
Raw Normal View History

include::../description.adoc[]
== Noncompliant Code Example
----
switch (variable) {
case 0:
doSomething();
default:
doSomethingElse();
}
----
== Compliant Solution
----
if (variable == 0) {
doSomething();
} else {
doSomethingElse();
}
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::rspecator-view[]