summaryrefslogblamecommitdiffstats
path: root/core/src/hasher.rs
blob: 13180e41881594c654836d6e26a01f0fdb6a87dc (plain) (tree)
1
2
3
4
5
6
7
8
                                       

                                                                                                               
                                        
 

                                       
                            





                             
/// The hasher used to compare layouts.
#[allow(missing_debug_implementations)] // Doesn't really make sense to have debug on the hasher state anyways.
#[derive(Default)]
pub struct Hasher(rustc_hash::FxHasher);

impl core::hash::Hasher for Hasher {
    fn write(&mut self, bytes: &[u8]) {
        self.0.write(bytes);
    }

    fn finish(&self) -> u64 {
        self.0.finish()
    }
}