-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
trait Foo {
fn from_usize(x: usize) -> Self;
}
impl Foo for usize {
fn from_usize(x: usize) -> Self { x }
}
fn main() {}
Gives:
warning: methods called `from_*` usually take no `self`
--> src/main.rs:5:19
|
5 | fn from_usize(x: usize) -> Self { x }
| ^
|
= note: `#[warn(clippy::wrong_self_convention)]` on by default
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
But this from_usize isn't taking self
.
Metadata
Metadata
Assignees
Labels
No labels