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

or_fun_call: fix suggestion for or_insert(vec![]) #6790

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

mgacek8
Copy link
Contributor

@mgacek8 mgacek8 commented Feb 25, 2021

fixes #6748
changelog: or_fun_call: fix suggestion for or_insert(vec![]) on std::collections::hash_map::Entry or std::collections::btree_map::Entry

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 25, 2021
Applies for `std::collections::hash_map::Entry` and `std::collections::btree_map::Entry`

Example:
Previously, for the following code:
`let _ = hash_map.entry("test".to_owned()).or_insert(vec![]);`
clippy would suggest to use:
`or_insert_with(vec![])`, which causes a compiler error (E0277).

Now clippy suggests:
`or_insert_with(Vec::new)`
@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Collaborator

bors commented Feb 25, 2021

📌 Commit 2f0e9f7 has been approved by Manishearth

bors added a commit that referenced this pull request Feb 25, 2021
or_fun_call: fix suggestion for `or_insert(vec![])`

fixes #6748
changelog: or_fun_call: fix suggestion for `or_insert(vec![])` on `std::collections::hash_map::Entry` or `std::collections::btree_map::Entry`
@bors
Copy link
Collaborator

bors commented Feb 25, 2021

⌛ Testing commit 2f0e9f7 with merge 29267a9...

@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Collaborator

bors commented Feb 25, 2021

💡 This pull request was already approved, no need to approve it again.

  • This pull request is currently being tested. If there's no response from the continuous integration service, you may use retry to trigger a build again.

@bors
Copy link
Collaborator

bors commented Feb 25, 2021

📌 Commit 2f0e9f7 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Feb 25, 2021

⌛ Testing commit 2f0e9f7 with merge 5c6cd87...

@bors
Copy link
Collaborator

bors commented Feb 25, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 5c6cd87 to master...

@bors bors merged commit 5c6cd87 into rust-lang:master Feb 25, 2021
@mgacek8 mgacek8 deleted the issue_6748 branch March 20, 2021 10:36
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
4 participants