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

Add RustcVacantEntry::insert_entry for rust-lang/rust#64656 #118

Merged
merged 2 commits into from Oct 4, 2019

Conversation

@passcod
Copy link
Contributor

commented Sep 30, 2019

See rust-lang/rust#64656.

This was based on v0.5.0 as that's what rustc uses; I can rebase onto master, but I'm not sure whether rustc wants v0.6.0 or if v0.6.0 is rustc-ready.

For context, this ultimately provides an API with this shape:

impl Entry<'a, K, V> {
    fn insert(self, value: V) -> OccupiedEntry<'a, K, V> {…}
}

to be used when one wants to insert a value without consuming the Entry, e.g. because one wants to keep a reference to the key around. There's more at the original (defunct) PR: rust-lang/rust#60142.

@passcod passcod changed the title Map entry insert Add RustcVacantEntry::insert_and_return for rust-lang/rustc#64656 Sep 30, 2019
@passcod passcod changed the title Add RustcVacantEntry::insert_and_return for rust-lang/rustc#64656 Add RustcVacantEntry::insert_and_return for rust-lang/rust#64656 Sep 30, 2019
@Amanieu

This comment has been minimized.

Copy link
Collaborator

commented Sep 30, 2019

Please rebase onto master. Also you'll want to run rustfmt.

@Amanieu

This comment has been minimized.

Copy link
Collaborator

commented Sep 30, 2019

There are a few CI failures, but they seem unrelated to this PR.

@Amanieu Amanieu changed the title Add RustcVacantEntry::insert_and_return for rust-lang/rust#64656 Add RustcVacantEntry::insert_entry for rust-lang/rust#64656 Sep 30, 2019
@passcod

This comment has been minimized.

Copy link
Contributor Author

commented Sep 30, 2019

I can implement the insert method for the other public Entry APIs in this crate if wanted?

Done.

@passcod

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2019

Do I need to do anything for this to go further?

@Amanieu

This comment has been minimized.

Copy link
Collaborator

commented Oct 4, 2019

I'm just waiting for #120 to land before merging this.

@passcod

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2019

Ah, thanks!

@Amanieu

This comment has been minimized.

Copy link
Collaborator

commented Oct 4, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2019

📌 Commit ecbdeb9 has been approved by Amanieu

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2019

⌛️ Testing commit ecbdeb9 with merge 62a1ae2...

bors added a commit that referenced this pull request Oct 4, 2019
Add RustcVacantEntry::insert_entry for rust-lang/rust#64656

See rust-lang/rust#64656.

~~This was based on v0.5.0 as that's what rustc uses; I can rebase onto master, but I'm not sure whether rustc wants v0.6.0 or if v0.6.0 is rustc-ready.~~

For context, this ultimately provides an API with this shape:

```rust
impl Entry<'a, K, V> {
    fn insert(self, value: V) -> OccupiedEntry<'a, K, V> {…}
}
```

to be used when one wants to insert a value without consuming the Entry, e.g. because one wants to keep a reference to the key around. There's more at the original (defunct) PR: rust-lang/rust#60142.
@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2019

☀️ Test successful - checks-travis
Approved by: Amanieu
Pushing 62a1ae2 to master...

@bors bors merged commit ecbdeb9 into rust-lang:master Oct 4, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@passcod passcod deleted the passcod:map-entry-insert branch Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.