diff options
Diffstat (limited to 'src/tools/clippy/src/docs/unused_self.txt')
-rw-r--r-- | src/tools/clippy/src/docs/unused_self.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/unused_self.txt b/src/tools/clippy/src/docs/unused_self.txt new file mode 100644 index 000000000..a8d0fc759 --- /dev/null +++ b/src/tools/clippy/src/docs/unused_self.txt @@ -0,0 +1,23 @@ +### What it does +Checks methods that contain a `self` argument but don't use it + +### Why is this bad? +It may be clearer to define the method as an associated function instead +of an instance method if it doesn't require `self`. + +### Example +``` +struct A; +impl A { + fn method(&self) {} +} +``` + +Could be written: + +``` +struct A; +impl A { + fn method() {} +} +```
\ No newline at end of file |