Skip to content

Commit

Permalink
Change terminology from static to associated
Browse files Browse the repository at this point in the history
  • Loading branch information
james9909 authored and flip1995 committed Oct 15, 2019
1 parent 8b50599 commit adf5886
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/unused_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::utils::span_help_and_lint;
declare_clippy_lint! {
/// **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 a static function instead
/// **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`.
///
/// **Known problems:** None.
Expand Down Expand Up @@ -68,7 +68,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf {
UNUSED_SELF,
self_param.span,
"unused `self` argument",
"consider refactoring to a static method or function",
"consider refactoring to a associated function",
)
}
}
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/unused_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,71 @@ LL | fn unused_self_move(self) {}
| ^^^^
|
= note: `-D clippy::unused-self` implied by `-D warnings`
= help: consider refactoring to a static method or function
= help: consider refactoring to a associated function

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

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

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

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

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

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

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

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

error: aborting due to 9 previous errors

0 comments on commit adf5886

Please sign in to comment.