]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/src/docs/unused_self.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / unused_self.txt
1 ### What it does
2 Checks methods that contain a `self` argument but don't use it
3
4 ### Why is this bad?
5 It may be clearer to define the method as an associated function instead
6 of an instance method if it doesn't require `self`.
7
8 ### Example
9 ```
10 struct A;
11 impl A {
12 fn method(&self) {}
13 }
14 ```
15
16 Could be written:
17
18 ```
19 struct A;
20 impl A {
21 fn method() {}
22 }
23 ```