iddqd/support/
hash_builder.rs1#[cfg(feature = "default-hasher")]
5pub type DefaultHashBuilder = foldhash::fast::RandomState;
6
7#[cfg(not(feature = "default-hasher"))]
8mod dummy {
9 use core::hash::{BuildHasher, Hasher};
10
11 #[derive(Clone, Copy, Debug)]
15 pub enum DefaultHashBuilder {}
16
17 impl BuildHasher for DefaultHashBuilder {
18 type Hasher = Self;
19
20 fn build_hasher(&self) -> Self::Hasher {
21 unreachable!("this is an empty enum so self cannot exist")
22 }
23 }
24
25 impl Hasher for DefaultHashBuilder {
26 fn write(&mut self, _bytes: &[u8]) {
27 unreachable!("this is an empty enum so self cannot exist")
28 }
29
30 fn finish(&self) -> u64 {
31 unreachable!("this is an empty enum so self cannot exist")
32 }
33 }
34}
35
36#[cfg(not(feature = "default-hasher"))]
37pub use dummy::DefaultHashBuilder;