bittern 1.0.1

A reference-counted arena for interning and deduplicating data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use core::hash::{BuildHasher, Hash, Hasher};
use ahash::RandomState;

pub(crate) type DefaultState = RandomState;

/// Uses the core::hash traits to hash a value
pub(crate) fn core_hash<K, S>(key: K, state: &S) -> u64
where K: Hash, S: BuildHasher
{
    let mut hasher = state.build_hasher();
    key.hash(&mut hasher);
    hasher.finish()
}