Skip to content
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

Merged
merged 5 commits into from
Mar 18, 2019
Merged

Conversation

marcusklaas
Copy link
Collaborator

No description provided.

src/linklabel.rs Outdated Show resolved Hide resolved
src/linklabel.rs Outdated Show resolved Hide resolved
src/scanners.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@raphlinus raphlinus left a 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.

src/parse.rs Outdated Show resolved Hide resolved
@@ -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 {
Copy link
Collaborator

@raphlinus raphlinus Mar 18, 2019

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.

Copy link
Collaborator Author

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.

@marcusklaas marcusklaas merged commit 3e4ef16 into pulldown-cmark:master Mar 18, 2019
@marcusklaas marcusklaas deleted the clippy branch March 18, 2019 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants