Skip to content

Commit 4a9e887

Browse files
authored
Merge pull request #178 from cuviper/release-1.6.2
Release 1.6.2
2 parents 1f1e049 + 6b54fde commit 4a9e887

File tree

7 files changed

+22
-9
lines changed

7 files changed

+22
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "indexmap"
33
edition = "2018"
4-
version = "1.6.1"
4+
version = "1.6.2"
55
authors = [
66
"bluss",
77
"Josh Stone <[email protected]>"

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ which is roughly:
6666
Recent Changes
6767
==============
6868

69+
- 1.6.2
70+
71+
- Fixed to match ``std`` behavior, ``OccupiedEntry::key`` now references the
72+
existing key in the map instead of the lookup key, by @cuviper in PR 170_.
73+
74+
- The new ``Entry::or_insert_with_key`` matches Rust 1.50's ``Entry`` method,
75+
passing ``&K`` to the callback to create a value, by @cuviper in PR 175_.
76+
77+
.. _170: https://github.com/bluss/indexmap/pull/170
78+
.. _175: https://github.com/bluss/indexmap/pull/175
79+
6980
- 1.6.1
7081

7182
- The new ``serde_seq`` module implements ``IndexMap`` serialization as a

src/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ mod tests {
16651665
let ptr = *e.key() as *const i32;
16661666
assert_eq!(ptr, k1_ptr);
16671667
assert_ne!(ptr, k2_ptr);
1668-
},
1668+
}
16691669
Entry::Vacant(_) => panic!(),
16701670
}
16711671
}

src/map/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ impl<K, V> OccupiedEntry<'_, K, V> {
563563
///
564564
/// Like `Vec::swap_remove`, the pair is removed by swapping it with the
565565
/// last element of the map and popping it off. **This perturbs
566-
/// the postion of what used to be the last element!**
566+
/// the position of what used to be the last element!**
567567
///
568568
/// Computes in **O(1)** time (average).
569569
pub fn swap_remove(self) -> V {

src/map/core/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
152152
///
153153
/// Like `Vec::swap_remove`, the pair is removed by swapping it with the
154154
/// last element of the map and popping it off. **This perturbs
155-
/// the postion of what used to be the last element!**
155+
/// the position of what used to be the last element!**
156156
///
157157
/// Computes in **O(1)** time (average).
158158
pub fn swap_remove_entry(self) -> (K, V) {

src/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ where
425425
///
426426
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
427427
/// last element of the set and popping it off. **This perturbs
428-
/// the postion of what used to be the last element!**
428+
/// the position of what used to be the last element!**
429429
///
430430
/// Return `false` if `value` was not in the set.
431431
///
@@ -473,7 +473,7 @@ where
473473
///
474474
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
475475
/// last element of the set and popping it off. **This perturbs
476-
/// the postion of what used to be the last element!**
476+
/// the position of what used to be the last element!**
477477
///
478478
/// Return `None` if `value` was not in the set.
479479
///
@@ -506,7 +506,7 @@ where
506506
///
507507
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
508508
/// last element of the set and popping it off. **This perturbs
509-
/// the postion of what used to be the last element!**
509+
/// the position of what used to be the last element!**
510510
///
511511
/// Return `None` if `value` was not in the set.
512512
pub fn swap_remove_full<Q: ?Sized>(&mut self, value: &Q) -> Option<(usize, T)>
@@ -622,7 +622,7 @@ impl<T, S> IndexSet<T, S> {
622622
///
623623
/// Like `Vec::swap_remove`, the value is removed by swapping it with the
624624
/// last element of the set and popping it off. **This perturbs
625-
/// the postion of what used to be the last element!**
625+
/// the position of what used to be the last element!**
626626
///
627627
/// Computes in **O(1)** time (average).
628628
pub fn swap_remove_index(&mut self, index: usize) -> Option<T> {

test-nostd/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use indexmap::IndexSet;
1111
struct BadHasher(u64);
1212

1313
impl Hasher for BadHasher {
14-
fn finish(&self) -> u64 { self.0 }
14+
fn finish(&self) -> u64 {
15+
self.0
16+
}
1517
fn write(&mut self, bytes: &[u8]) {
1618
for &byte in bytes {
1719
self.0 += byte as u64

0 commit comments

Comments
 (0)