Skip to content

Conversation

HMPerson1
Copy link
Contributor

Closes #4586

changelog: Add inefficient_to_string lint, which checks for calling to_string on &&str, which would bypass the str's specialization

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 17, 2019
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else LGTM.

@@ -0,0 +1,31 @@
#![deny(clippy::inefficient_to_string)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add // run-rustfix to make this a rustfix test?

@flip1995 flip1995 added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Oct 17, 2019
@HMPerson1 HMPerson1 force-pushed the inefficient_to_string branch from 0674d01 to ffb53e7 Compare October 17, 2019 16:41
@HMPerson1 HMPerson1 requested a review from flip1995 October 17, 2019 18:58
@Manishearth
Copy link
Member

(You'll also need to update the test expectations)

@HMPerson1 HMPerson1 force-pushed the inefficient_to_string branch from 82dbeb3 to 2106a23 Compare October 17, 2019 23:13
@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Contributor

bors commented Oct 17, 2019

📌 Commit 2106a23 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Oct 17, 2019

⌛ Testing commit 2106a23 with merge 14a0f36...

bors added a commit that referenced this pull request Oct 17, 2019
Add `inefficient_to_string` lint

Closes #4586

changelog: Add `inefficient_to_string` lint, which checks for calling `to_string` on `&&str`, which would bypass the `str`'s specialization
@bors
Copy link
Contributor

bors commented Oct 18, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Manishearth
Pushing 14a0f36 to master...

@bors bors merged commit 2106a23 into rust-lang:master Oct 18, 2019
@HMPerson1 HMPerson1 deleted the inefficient_to_string branch October 18, 2019 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint against calling to_string() on &&str, &&String, etc.
5 participants