Rethink workspace structure
This commit is contained in:
parent
8b8f7563ad
commit
a97401aed2
44 changed files with 684 additions and 51 deletions
19
src/hasher.rs
Normal file
19
src/hasher.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/// The hasher used to compare layouts.
|
||||
#[derive(Debug)]
|
||||
pub struct Hasher(twox_hash::XxHash64);
|
||||
|
||||
impl Default for Hasher {
|
||||
fn default() -> Self {
|
||||
Hasher(twox_hash::XxHash64::default())
|
||||
}
|
||||
}
|
||||
|
||||
impl core::hash::Hasher for Hasher {
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
self.0.write(bytes)
|
||||
}
|
||||
|
||||
fn finish(&self) -> u64 {
|
||||
self.0.finish()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue