Is there any way to get Hasher::write
to just pass my u64
through.
pub struct Trie<T> {
// in order to avoid lifetime headaches I pre-hash a tuple of
// (preceding_seq: &[T}, current_value: &T) so I don't have to
// store that same tuple
children: HashMap<u64, Node<T>>
}
this is the original definition for FnvHasher
impl Hasher for NoopHasher {
#[inline]
fn finish(&self) -> u64 {
self.0
}
#[inline]
fn write(&mut self, bytes: &[u8]) {
let NoopHasher(mut hash) = *self;
for byte in bytes.iter() {
hash = hash ^ (*byte as u64);
hash = hash.wrapping_mul(0x100000001b3);
}
*self = NoopHasher(hash);
}
}
any ideas appreciated
thanks