-
Notifications
You must be signed in to change notification settings - Fork 235
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
Some clippy assisted cleanups #208
Conversation
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.
Generally looks good, see a couple comments inside.
@@ -149,7 +149,7 @@ impl<'a> Borrow<str> for CowStr<'a> { | |||
} | |||
|
|||
impl<'a> CowStr<'a> { | |||
pub fn to_string(self) -> String { | |||
pub fn into_string(self) -> String { |
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.
Agree but note this is a semver break. It's fine if it's scooped into the 0.4 release.
Also, I'm not sure the motivation for this is golden. Looking at rust-lang/rust-clippy#23 , it used to be the case that to_string
was slower, but that got fixed.
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 don't think that's the reasoning behind the lint. to_string
used to be slower because it went through the fmt::Display
machinery, but that's not relevant here.
The lint that triggered this change seemed to warn against to_*
methods taking self by value instead of by reference, that's all.
No description provided.