Skip to content

Commit

Permalink
Merge pull request #304 from cuviper/raw-into_key
Browse files Browse the repository at this point in the history
Fix `RawOccupiedEntryMut::into_key`, release 2.2.1
  • Loading branch information
cuviper authored Jan 29, 2024
2 parents 7107c49 + 244bd81 commit 7264ce4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "indexmap"
edition = "2021"
version = "2.2.0"
version = "2.2.1"
documentation = "https://docs.rs/indexmap/"
repository = "https://github.com/indexmap-rs/indexmap"
license = "Apache-2.0 OR MIT"
Expand Down
6 changes: 6 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- 2.2.1

- Corrected the signature of `RawOccupiedEntryMut::into_key(self) -> &'a mut K`,
This a breaking change from 2.2.0, but that version was published for less
than a day and has now been yanked.

- 2.2.0

- The new `IndexMap::get_index_entry` method finds an entry by its index for
Expand Down
4 changes: 2 additions & 2 deletions src/map/core/raw_entry_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ impl<'a, K, V, S> RawOccupiedEntryMut<'a, K, V, S> {
/// Note that this is not the key that was used to find the entry. There may be an observable
/// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like
/// extra fields or the memory address of an allocation.
pub fn into_key(&mut self) -> &mut K {
&mut self.raw.bucket_mut().key
pub fn into_key(self) -> &'a mut K {
&mut self.raw.into_bucket().key
}

/// Gets a reference to the entry's value in the map.
Expand Down

0 comments on commit 7264ce4

Please sign in to comment.