Skip to content

Commit adf5886

Browse files
james9909flip1995
authored andcommitted
Change terminology from static to associated
1 parent 8b50599 commit adf5886

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

clippy_lints/src/unused_self.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::utils::span_help_and_lint;
1010
declare_clippy_lint! {
1111
/// **What it does:** Checks methods that contain a `self` argument but don't use it
1212
///
13-
/// **Why is this bad?** It may be clearer to define the method as a static function instead
13+
/// **Why is this bad?** It may be clearer to define the method as an associated function instead
1414
/// of an instance method if it doesn't require `self`.
1515
///
1616
/// **Known problems:** None.
@@ -68,7 +68,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf {
6868
UNUSED_SELF,
6969
self_param.span,
7070
"unused `self` argument",
71-
"consider refactoring to a static method or function",
71+
"consider refactoring to a associated function",
7272
)
7373
}
7474
}

tests/ui/unused_self.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,71 @@ LL | fn unused_self_move(self) {}
55
| ^^^^
66
|
77
= note: `-D clippy::unused-self` implied by `-D warnings`
8-
= help: consider refactoring to a static method or function
8+
= help: consider refactoring to a associated function
99

1010
error: unused `self` argument
1111
--> $DIR/unused_self.rs:12:28
1212
|
1313
LL | fn unused_self_ref(&self) {}
1414
| ^^^^^
1515
|
16-
= help: consider refactoring to a static method or function
16+
= help: consider refactoring to a associated function
1717

1818
error: unused `self` argument
1919
--> $DIR/unused_self.rs:13:32
2020
|
2121
LL | fn unused_self_mut_ref(&mut self) {}
2222
| ^^^^^^^^^
2323
|
24-
= help: consider refactoring to a static method or function
24+
= help: consider refactoring to a associated function
2525

2626
error: unused `self` argument
2727
--> $DIR/unused_self.rs:14:32
2828
|
2929
LL | fn unused_self_pin_ref(self: Pin<&Self>) {}
3030
| ^^^^
3131
|
32-
= help: consider refactoring to a static method or function
32+
= help: consider refactoring to a associated function
3333

3434
error: unused `self` argument
3535
--> $DIR/unused_self.rs:15:36
3636
|
3737
LL | fn unused_self_pin_mut_ref(self: Pin<&mut Self>) {}
3838
| ^^^^
3939
|
40-
= help: consider refactoring to a static method or function
40+
= help: consider refactoring to a associated function
4141

4242
error: unused `self` argument
4343
--> $DIR/unused_self.rs:16:35
4444
|
4545
LL | fn unused_self_pin_nested(self: Pin<Arc<Self>>) {}
4646
| ^^^^
4747
|
48-
= help: consider refactoring to a static method or function
48+
= help: consider refactoring to a associated function
4949

5050
error: unused `self` argument
5151
--> $DIR/unused_self.rs:17:28
5252
|
5353
LL | fn unused_self_box(self: Box<Self>) {}
5454
| ^^^^
5555
|
56-
= help: consider refactoring to a static method or function
56+
= help: consider refactoring to a associated function
5757

5858
error: unused `self` argument
5959
--> $DIR/unused_self.rs:18:40
6060
|
6161
LL | fn unused_with_other_used_args(&self, x: u8, y: u8) -> u8 {
6262
| ^^^^^
6363
|
64-
= help: consider refactoring to a static method or function
64+
= help: consider refactoring to a associated function
6565

6666
error: unused `self` argument
6767
--> $DIR/unused_self.rs:21:37
6868
|
6969
LL | fn unused_self_class_method(&self) {
7070
| ^^^^^
7171
|
72-
= help: consider refactoring to a static method or function
72+
= help: consider refactoring to a associated function
7373

7474
error: aborting due to 9 previous errors
7575

0 commit comments

Comments
 (0)