1 2 3 4 5 6 7 8 9 10
use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; // FIXME: Move to tests. #[allow(dead_code)] pub fn calculate_hash<T: Hash>(t: &T) -> u64 { let mut s = DefaultHasher::new(); t.hash(&mut s); s.finish() }