weak-table 0.4.0-pre1

Weak hash maps and sets
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Internal utility functions.

use crate::compat::*;

/// Use `hash_builder` to compute the hash of `value`.
///
/// (We provide this because [`BuildHasher::hash_one`] is not available at our MSRV.)
pub(crate) fn hash_one<H: Hash + ?Sized, S: BuildHasher>(hash_builder: &S, value: &H) -> u64 {
    let mut hasher = hash_builder.build_hasher();
    value.hash(&mut hasher);
    hasher.finish()
}