2019-07-20 19:12:31 +02:00
|
|
|
/// The hasher used to compare layouts.
|
2023-09-12 18:15:00 -04:00
|
|
|
#[allow(missing_debug_implementations)] // Doesn't really make sense to have debug on the hasher state anyways.
|
|
|
|
|
#[derive(Default)]
|
2024-03-30 15:57:12 +01:00
|
|
|
pub struct Hasher(rustc_hash::FxHasher);
|
2019-08-30 01:54:41 +02:00
|
|
|
|
|
|
|
|
impl core::hash::Hasher for Hasher {
|
|
|
|
|
fn write(&mut self, bytes: &[u8]) {
|
2023-09-20 04:11:52 +02:00
|
|
|
self.0.write(bytes);
|
2019-08-30 01:54:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn finish(&self) -> u64 {
|
|
|
|
|
self.0.finish()
|
|
|
|
|
}
|
|
|
|
|
}
|