You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tui-rs/src/util.rs

12 lines
272 B
Rust

use std::collections::hash_map::RandomState;
use std::hash::{Hash, Hasher, BuildHasher};
use layout::Rect;
pub fn hash<T: Hash>(t: &T) -> u64 {
let state = RandomState::new();
let mut hasher = state.build_hasher();
t.hash(&mut hasher);
hasher.finish()
}