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

Extend implicit_clone to handle to_string calls #14177

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

smoelius
Copy link
Contributor

@smoelius smoelius commented Feb 9, 2025

Put another way, merge string_to_string into implicit_clone, as suggested here: #14173 (comment)

Note: I wrote this comment:

/// Note that `to_string` is not flagged by `implicit_clone`. So other lints that call
/// `is_clone_like` and that do flag `to_string` must handle it separately. See, e.g.,
/// `is_to_owned_like` in `unnecessary_to_owned.rs`.

Here is the context for why I wrote it: #7978 (comment)

Regardless, it's probably time for the comment to go away. Extending implicit_clone to handle to_string calls yields many hits within Clippy's codebase.

changelog: extend implicit_clone to handle to_string calls

@rustbot
Copy link
Collaborator

rustbot commented Feb 9, 2025

r? @y21

rustbot has assigned @y21.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 9, 2025
@smoelius smoelius force-pushed the implicit-clone-to-string branch 2 times, most recently from 72eccf1 to a1615be Compare February 9, 2025 01:01
@smoelius
Copy link
Contributor Author

smoelius commented Feb 9, 2025

@y21 Sorry for the force pushes. I think it should be good now.

@smoelius smoelius force-pushed the implicit-clone-to-string branch from a1615be to cb609f7 Compare February 23, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants