mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Move all crates into a crates directory (#1940)
This commit is contained in:
19
crates/epaint/src/util/mod.rs
Normal file
19
crates/epaint/src/util/mod.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
mod ordered_float;
|
||||
|
||||
pub use ordered_float::*;
|
||||
|
||||
/// Hash the given value with a predictable hasher.
|
||||
#[inline]
|
||||
pub fn hash(value: impl std::hash::Hash) -> u64 {
|
||||
use std::hash::Hasher as _;
|
||||
let mut hasher = ahash::AHasher::default();
|
||||
value.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
|
||||
/// Hash the given value with the given hasher.
|
||||
#[inline]
|
||||
pub fn hash_with(value: impl std::hash::Hash, mut hasher: impl std::hash::Hasher) -> u64 {
|
||||
value.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
Reference in New Issue
Block a user