fn remove<Q: ?Sized, K, V, KH, VH>(
        key: &Q,
        key_data: &mut [Bucket<K, usize, B>],
        value_data: &mut [Bucket<V, usize, B>],
        key_hasher: &KH,
        value_hasher: &VH,
        map_len: &mut usize,
    ) -> Option<(K, V)>
    where
        Q: Hash + Eq,
        K: Hash + Eq + Borrow<Q>,
        V: Hash,
        KH: BuildHasher,
        VH: BuildHasher,
    {
        let len = key_data.len();
        let index = Self::find_ideal_index(&key, key_hasher, len);

        let neighbourhood = key_data[index].neighbourhood;
        if let Some(offset) =
            neighbourhood
                .iter()
                .find(|offset| match key_data[(index + offset) % len].data {
                    Some((ref candidate_key, ..)) => candidate_key.borrow() == key,
                    _ => false,
                })
        {
            key_data[index].neighbourhood = neighbourhood & B::zero_at(offset);
            let (key, value_index, _) = key_data[(index + offset) % len].data.take().unwrap();
            let (value, ..) = value_data[value_index].data.take().unwrap();

            let ideal_value_index = Self::find_ideal_index(&value, value_hasher, len);
            let value_offset = (value_index + len - ideal_value_index) % len;

            value_data[ideal_value_index].neighbourhood =
                value_data[ideal_value_index].neighbourhood & B::zero_at(value_offset);

            *map_len -= 1;

            Some((key, value))
        } else {
            None
        }
    }
/// Removes a key from the key_data section of the hashmap, and removes the value from the
/// value_data section of the hashmap. Returns the value that is associated with the key, if it
/// exists.
Removes a key from the key_data section of the hashmap, and removes the value from the
value_data section of the hashmap. Returns the value that is associated with the key, if it
exists.
Removes a key from the key_data section of the hashmap and removes the value from the value_data section of the hashmap . Returns the value that is associated with the key if it exists .
fn remove<Q: ?Sized, K, V, KH, VH>(
        key: &Q,
        key_data: &mut [Bucket<K, usize, B>],
        value_data: &mut [Bucket<V, usize, B>],
        key_hasher: &KH,
        value_hasher: &VH,
        map_len: &mut usize,
    ) -> Option<(K, V)>
    where
        Q: Hash + Eq,
        K: Hash + Eq + Borrow<Q>,
        V: Hash,
        KH: BuildHasher,
        VH: BuildHasher,
    {
        let len = key_data.len();
        let index = Self::find_ideal_index(&key, key_hasher, len);
        let neighbourhood = key_data[index].neighbourhood;
        if let Some(offset) =
            neighbourhood
                .iter()
                .find(|offset| match key_data[(index + offset) % len].data {
                    Some((ref candidate_key, ..)) => candidate_key.borrow() == key,
                    _ => false,
                })
        {
            key_data[index].neighbourhood = neighbourhood & B::zero_at(offset);
            let (key, value_index, _) = key_data[(index + offset) % len].data.take().unwrap();
            let (value, ..) = value_data[value_index].data.take().unwrap();
            let ideal_value_index = Self::find_ideal_index(&value, value_hasher, len);
            let value_offset = (value_index + len - ideal_value_index) % len;
            value_data[ideal_value_index].neighbourhood =
                value_data[ideal_value_index].neighbourhood & B::zero_at(value_offset);
            *map_len -= 1;
            Some((key, value))
        } else {
            None
        }
    }
fn remove < Q : ? Sized , K , V , KH , VH > ( key : & Q , key_data : & mut [ Bucket < K , usize , B > ] , value_data : & mut [ Bucket < V , usize , B > ] , key_hasher : & KH , value_hasher : & VH , map_len : & mut usize , ) -> Option < ( K , V ) > where Q : Hash + Eq , K : Hash + Eq + Borrow < Q > , V : Hash , KH : BuildHasher , VH : BuildHasher , { let len = key_data . len ( ) ; let index = Self :: find_ideal_index ( & key , key_hasher , len ) ; let neighbourhood = key_data [ index ] . neighbourhood ; if let Some ( offset ) = neighbourhood . iter ( ) . find ( | offset | match key_data [ ( index + offset ) % len ] . data { Some ( ( ref candidate_key , .. ) ) => candidate_key . borrow ( ) == key , _ => false , } ) { key_data [ index ] . neighbourhood = neighbourhood & B :: zero_at ( offset ) ; let ( key , value_index , _ ) = key_data [ ( index + offset ) % len ] . data . take ( ) . unwrap ( ) ; let ( value , .. ) = value_data [ value_index ] . data . take ( ) . unwrap ( ) ; let ideal_value_index = Self :: find_ideal_index ( & value , value_hasher , len ) ; let value_offset = ( value_index + len - ideal_value_index ) % len ; value_data [ ideal_value_index ] . neighbourhood = value_data [ ideal_value_index ] . neighbourhood & B :: zero_at ( value_offset ) ; * map_len -= 1 ; Some ( ( key , value ) ) } else { None } }
Removes a key from the key_data section of the hashmap, and removes the value from the
value_data section of the hashmap.
Removes a key from the key_data section of the hashmap and removes the value from the value_data section of the hashmap .
key
&Q
key_data
&mut [Bucket<K, usize, B>]
value_data
&mut [Bucket<V, usize, B>]
key_hasher
&KH
value_hasher
&VH
map_len
&mut usize
key
&Q
key_data
&mut [Bucket<K, usize, B>]
value_data
&mut [Bucket<V, usize, B>]
key_hasher
&KH
value_hasher
&VH
map_len
&mut usize