Skip to content

Commit c773eb2

Browse files
committed
Making example more ergonomic
1 parent cbe6d15 commit c773eb2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,10 +2047,10 @@ impl<K, V, S, A: Allocator + Clone> HashMap<K, V, S, A> {
20472047
/// is_match: F,
20482048
/// ) -> Option<(K, V)>
20492049
/// where
2050-
/// F: Fn(&K, &V) -> bool,
2050+
/// F: Fn(&(K, V)) -> bool,
20512051
/// {
20522052
/// let raw_table = map.raw_table();
2053-
/// match raw_table.find(hash, |(k, v)| is_match(k, v)) {
2053+
/// match raw_table.find(hash, is_match) {
20542054
/// Some(bucket) => Some(unsafe { raw_table.remove(bucket) }),
20552055
/// None => None,
20562056
/// }
@@ -2064,7 +2064,7 @@ impl<K, V, S, A: Allocator + Clone> HashMap<K, V, S, A> {
20642064
/// }
20652065
///
20662066
/// let hash = compute_hash(map.hasher(), "a");
2067-
/// assert_eq!(remove_by_hash(&mut map, hash, |_, v| *v == 10), Some(("a", 10)));
2067+
/// assert_eq!(remove_by_hash(&mut map, hash, |(_, v)| *v == 10), Some(("a", 10)));
20682068
/// assert_eq!(map.get(&"a"), None);
20692069
/// assert_eq!(map.len(), 2);
20702070
/// ```

0 commit comments

Comments
 (0)