Linting rules
E009: method-can-be-static
Checks for instance methods where `self` is unnecessary.
Metadata
Code:E009Rule:method-can-be-staticStatus: Stable sincev0.0.1Quick fix: not available
What it does
Checks for instance methods where self is unnecessary.
Why is this bad?
If self is never used, the method can be static which makes the API clearer.
Example
struct Foo {}
fun Foo.bar(self, a: int): int { return a + 1;
}Use instead:
struct Foo {}
fun Foo.bar(a: int): int {
return a + 1;
}Last updated on