Skip to content

Conversation

GuillaumeGomez
Copy link
Member

Fixes #8088.

Alternative to #12315.

r? @y21

changelog: Extend unnecessary_to_owned to handle Borrow trait in map types

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 20, 2024
@GuillaumeGomez
Copy link
Member Author

It allowed to detect two cases just in clippy, nice. :)

Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

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

This looks like a nice addition to the lint 👍 Makes sense to me to have this here.

@GuillaumeGomez
Copy link
Member Author

Updated!

Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

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

Just two more things and then I think it LGTM

@GuillaumeGomez
Copy link
Member Author

Updated!

@GuillaumeGomez
Copy link
Member Author

Reverted the match.

@y21
Copy link
Member

y21 commented Feb 21, 2024

Looks great now, thanks! :)

@bors r+

@bors
Copy link
Contributor

bors commented Feb 21, 2024

📌 Commit 635acb6 has been approved by y21

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 21, 2024

⌛ Testing commit 635acb6 with merge a248330...

bors added a commit that referenced this pull request Feb 21, 2024
Extend `unnecessary_to_owned` to handle `Borrow` trait in map types

Fixes #8088.

Alternative to #12315.

r? `@y21`

changelog: Extend `unnecessary_to_owned` to handle `Borrow` trait in map types
@bors
Copy link
Contributor

bors commented Feb 21, 2024

💔 Test failed - checks-action_test

@y21
Copy link
Member

y21 commented Feb 21, 2024

@bors retry

@bors
Copy link
Contributor

bors commented Feb 21, 2024

⌛ Testing commit 635acb6 with merge 250fd09...

@bors
Copy link
Contributor

bors commented Feb 21, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: y21
Pushing 250fd09 to master...

@bors bors merged commit 250fd09 into rust-lang:master Feb 21, 2024
@GuillaumeGomez GuillaumeGomez deleted the useless_allocation2 branch February 21, 2024 21:53
@GuillaumeGomez
Copy link
Member Author

Thanks for the great suggestions!

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.

[ER] Useless str -> String allocation

4 participants