Skip to content

Commit de60378

Browse files
committed
Remove search_bucket from raw_entry
1 parent 95062a0 commit de60378

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/map.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,17 +1355,6 @@ where
13551355
{
13561356
self.search(hash, is_match)
13571357
}
1358-
1359-
/// Search possible locations for an element with hash `hash` until `is_match` returns true for
1360-
/// one of them. There is no guarantee that all keys passed to `is_match` will have the provided
1361-
/// hash.
1362-
#[inline]
1363-
pub fn search_bucket<F>(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S>
1364-
where
1365-
for<'b> F: FnMut(&'b K) -> bool,
1366-
{
1367-
self.search(hash, is_match)
1368-
}
13691358
}
13701359

13711360
impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
@@ -1416,17 +1405,6 @@ where
14161405
{
14171406
self.search(hash, is_match)
14181407
}
1419-
1420-
/// Search possible locations for an element with hash `hash` until `is_match` returns true for
1421-
/// one of them. There is no guarantee that all keys passed to `is_match` will have the provided
1422-
/// hash.
1423-
#[inline]
1424-
pub fn search_bucket<F>(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)>
1425-
where
1426-
F: FnMut(&K) -> bool,
1427-
{
1428-
self.search(hash, is_match)
1429-
}
14301408
}
14311409

14321410
impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
@@ -3450,10 +3428,6 @@ mod test_map {
34503428
map.raw_entry().from_key_hashed_nocheck(hash1, &1).unwrap(),
34513429
(&1, &100)
34523430
);
3453-
assert_eq!(
3454-
map.raw_entry().search_bucket(hash1, |k| *k == 1).unwrap(),
3455-
(&1, &100)
3456-
);
34573431
assert_eq!(map.len(), 6);
34583432

34593433
// Existing key (update)
@@ -3475,10 +3449,6 @@ mod test_map {
34753449
map.raw_entry().from_key_hashed_nocheck(hash2, &2).unwrap(),
34763450
(&2, &200)
34773451
);
3478-
assert_eq!(
3479-
map.raw_entry().search_bucket(hash2, |k| *k == 2).unwrap(),
3480-
(&2, &200)
3481-
);
34823452
assert_eq!(map.len(), 6);
34833453

34843454
// Existing key (take)
@@ -3492,7 +3462,6 @@ mod test_map {
34923462
assert_eq!(map.raw_entry().from_key(&3), None);
34933463
assert_eq!(map.raw_entry().from_hash(hash3, |k| *k == 3), None);
34943464
assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash3, &3), None);
3495-
assert_eq!(map.raw_entry().search_bucket(hash3, |k| *k == 3), None);
34963465
assert_eq!(map.len(), 5);
34973466

34983467
// Nonexistent key (insert)
@@ -3514,7 +3483,6 @@ mod test_map {
35143483
assert_eq!(map.raw_entry().from_key(&k), kv);
35153484
assert_eq!(map.raw_entry().from_hash(hash, |q| *q == k), kv);
35163485
assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash, &k), kv);
3517-
assert_eq!(map.raw_entry().search_bucket(hash, |q| *q == k), kv);
35183486

35193487
match map.raw_entry_mut().from_key(&k) {
35203488
Occupied(mut o) => assert_eq!(Some(o.get_key_value()), kv),
@@ -3528,10 +3496,6 @@ mod test_map {
35283496
Occupied(mut o) => assert_eq!(Some(o.get_key_value()), kv),
35293497
Vacant(_) => assert_eq!(v, None),
35303498
}
3531-
match map.raw_entry_mut().search_bucket(hash, |q| *q == k) {
3532-
Occupied(mut o) => assert_eq!(Some(o.get_key_value()), kv),
3533-
Vacant(_) => assert_eq!(v, None),
3534-
}
35353499
}
35363500
}
35373501

0 commit comments

Comments
 (0)