mirror of https://github.com/fdehau/tui-rs
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.
13 lines
313 B
Rust
13 lines
313 B
Rust
use std::collections::hash_map::RandomState;
|
|
use std::hash::{Hash, Hasher, BuildHasher};
|
|
|
|
use layout::Rect;
|
|
|
|
pub fn hash<T: Hash>(t: &T, area: &Rect) -> u64 {
|
|
let state = RandomState::new();
|
|
let mut hasher = state.build_hasher();
|
|
t.hash(&mut hasher);
|
|
area.hash(&mut hasher);
|
|
hasher.finish()
|
|
}
|