rspec/rules/S2201/swift/rule.adoc
2020-12-23 14:59:06 +01:00

19 lines
713 B
Plaintext

When the call to a function doesn't have any side effects, what is the point of making the call if the results are ignored? In such case, either the function call is useless and should be dropped or the source code doesn't behave as expected.
This rule raises an issue on the following methods of the Swift standard library:
* ``abs`` function
* ``signum`` method
* ``distance`` method
* ``advanced`` method
* ``addingProduct`` method
* ``squareRoot`` method
* ``remainder``, ``truncatingRemainder`` methods
* ``rounded`` method
* ``dropLast``, ``drop``, ``dropFirst`` methods
* ``lowercased``, ``uppercased`` methods
* ``sorted``, ``reversed`` methods
* ``prefix``, ``suffix`` methods
include::../see.adoc[]