-
Notifications
You must be signed in to change notification settings - Fork 314
Commit 8f41ed4
committed
Rework the Entry API
The main change in this PR is that `OccupiedEntry` no longer holds the
key used in the initial `entry` call. As a result, `OccupiedEntryRef` is
no longer required since `OccupiedEntry` can be used in `EntryRef`
directly.
The following methods have been removed:
```rust
// hash_map
impl OccupiedEntry {
fn replace_entry(self, value: V) -> (K, V);
fn replace_key(self) -> K;
}
impl EntryRef {
fn and_replace_entry_with<F>(self, f: F) -> Self;
}
impl VacantEntryRef {
fn into_key(self) -> K;
}
// hash_set
impl Entry {
fn replace(self) -> T;
}
```
The following methods have been added:
```rust
impl VacantENtry {
fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, S, A>;
}
```
The following methods have their signatures changed:
```rust
impl EntryRef {
// Previously returned OccupiedEntryRef
fn insert(self, value: V) -> OccupiedEntry<'a, K, V, S, A>;
}
impl VacantEntryRef {
// Previously returned &Q
fn key(&self) -> &'b Q;
// Previously returned OccupiedEntryRef
fn insert(self, value: V) -> OccupiedEntry<'a, K, V, S, A>;
}
```1 parent f01e271 commit 8f41ed4Copy full SHA for 8f41ed4
0 commit comments