iced-yoda/web/src/hasher.rs

22 lines
423 B
Rust
Raw Normal View History

use std::collections::hash_map::DefaultHasher;
2019-12-19 00:09:19 +01:00
/// The hasher used to compare subscriptions.
#[derive(Debug)]
pub struct Hasher(DefaultHasher);
impl Default for Hasher {
fn default() -> Self {
Hasher(DefaultHasher::default())
}
}
impl core::hash::Hasher for Hasher {
fn write(&mut self, bytes: &[u8]) {
self.0.write(bytes)
}
fn finish(&self) -> u64 {
self.0.finish()
}
}