-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong_self_convention: to_
convention respects Copy
types
#6924
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,13 +75,13 @@ mod lifetimes { | |
|
||
mod issue2894 { | ||
trait IntoBytes { | ||
fn to_bytes(&self) -> Vec<u8>; | ||
fn to_bytes(self) -> Vec<u8>; | ||
} | ||
|
||
// This should not be linted | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this comment is correct, then why the |
||
impl IntoBytes for u8 { | ||
fn to_bytes(&self) -> Vec<u8> { | ||
vec![*self] | ||
fn to_bytes(self) -> Vec<u8> { | ||
vec![self] | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,13 +75,13 @@ mod lifetimes { | |
|
||
mod issue2894 { | ||
trait IntoBytes { | ||
fn to_bytes(&self) -> Vec<u8>; | ||
fn to_bytes(self) -> Vec<u8>; | ||
} | ||
|
||
// This should not be linted | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. I get that it's probably a different lint that should not trigger, but it still feels wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the comment says that |
||
impl IntoBytes for u8 { | ||
fn to_bytes(&self) -> Vec<u8> { | ||
vec![*self] | ||
fn to_bytes(self) -> Vec<u8> { | ||
vec![self] | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it wouldn't be more clear to have
n/a
instead ofnone
where the Postfix doesn't matter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't think an abbreviation of "not applicable" is clearer than "none" when there is no suffix, but that may be my dislike of needless abbreviations.