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

Release 1.6.2 #178

Merged
merged 3 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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