Skip to content

Commit

Permalink
Merge pull request #178 from cuviper/release-1.6.2
Browse files Browse the repository at this point in the history
Release 1.6.2
  • Loading branch information
cuviper committed Mar 5, 2021
2 parents 1f1e049 + 6b54fde commit 4a9e887
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 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 = "2018"
version = "1.6.1"
version = "1.6.2"
authors = [
"bluss",
"Josh Stone <cuviper@gmail.com>"
Expand Down
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ which is roughly:
Recent Changes
==============

- 1.6.2

- Fixed to match ``std`` behavior, ``OccupiedEntry::key`` now references the
existing key in the map instead of the lookup key, by @cuviper in PR 170_.

- The new ``Entry::or_insert_with_key`` matches Rust 1.50's ``Entry`` method,
passing ``&K`` to the callback to create a value, by @cuviper in PR 175_.

.. _170: https://github.com/bluss/indexmap/pull/170
.. _175: https://github.com/bluss/indexmap/pull/175

- 1.6.1

- The new ``serde_seq`` module implements ``IndexMap`` serialization as a
Expand Down
2 changes: 1 addition & 1 deletion src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ mod tests {
let ptr = *e.key() as *const i32;
assert_eq!(ptr, k1_ptr);
assert_ne!(ptr, k2_ptr);
},
}
Entry::Vacant(_) => panic!(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ impl<K, V> OccupiedEntry<'_, K, V> {
///
/// Like `Vec::swap_remove`, the pair is removed by swapping it with the
/// last element of the map and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Computes in **O(1)** time (average).
pub fn swap_remove(self) -> V {
Expand Down
2 changes: 1 addition & 1 deletion src/map/core/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
///
/// Like `Vec::swap_remove`, the pair is removed by swapping it with the
/// last element of the map and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Computes in **O(1)** time (average).
pub fn swap_remove_entry(self) -> (K, V) {
Expand Down
8 changes: 4 additions & 4 deletions src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ where
///
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
/// last element of the set and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Return `false` if `value` was not in the set.
///
Expand Down Expand Up @@ -473,7 +473,7 @@ where
///
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
/// last element of the set and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Return `None` if `value` was not in the set.
///
Expand Down Expand Up @@ -506,7 +506,7 @@ where
///
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
/// last element of the set and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Return `None` if `value` was not in the set.
pub fn swap_remove_full<Q: ?Sized>(&mut self, value: &Q) -> Option<(usize, T)>
Expand Down Expand Up @@ -622,7 +622,7 @@ impl<T, S> IndexSet<T, S> {
///
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
/// last element of the set and popping it off. **This perturbs
/// the postion of what used to be the last element!**
/// the position of what used to be the last element!**
///
/// Computes in **O(1)** time (average).
pub fn swap_remove_index(&mut self, index: usize) -> Option<T> {
Expand Down
4 changes: 3 additions & 1 deletion test-nostd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use indexmap::IndexSet;
struct BadHasher(u64);

impl Hasher for BadHasher {
fn finish(&self) -> u64 { self.0 }
fn finish(&self) -> u64 {
self.0
}
fn write(&mut self, bytes: &[u8]) {
for &byte in bytes {
self.0 += byte as u64
Expand Down

0 comments on commit 4a9e887

Please sign in to comment.