2547edb842
When a method starts with `to_` and ends with `_mut`, it should expect a `&mut self` parameter, otherwise `&self`.
20 lines
678 B
Plaintext
20 lines
678 B
Plaintext
error: methods called `to_*` usually take self by reference
|
|
--> $DIR/wrong_self_conventions_mut.rs:15:24
|
|
|
|
|
LL | pub fn to_many(&mut self) -> Option<&mut [T]> {
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
|
|
= help: consider choosing a less ambiguous name
|
|
|
|
error: methods called like this: (`to_*` and `*_mut`) usually take self by mutable reference
|
|
--> $DIR/wrong_self_conventions_mut.rs:23:28
|
|
|
|
|
LL | pub fn to_many_mut(&self) -> Option<&[T]> {
|
|
| ^^^^^
|
|
|
|
|
= help: consider choosing a less ambiguous name
|
|
|
|
error: aborting due to 2 previous errors
|
|
|