mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Various small improvements
This commit is contained in:
@@ -43,14 +43,14 @@ impl Id {
|
||||
Self(1)
|
||||
}
|
||||
|
||||
pub fn new<H: Hash>(source: &H) -> Id {
|
||||
pub fn new<H: Hash>(source: H) -> Id {
|
||||
use std::hash::Hasher;
|
||||
let mut hasher = DefaultHasher::new();
|
||||
source.hash(&mut hasher);
|
||||
Id(hasher.finish())
|
||||
}
|
||||
|
||||
pub fn with<H: Hash>(self, child: &H) -> Id {
|
||||
pub fn with<H: Hash>(self, child: H) -> Id {
|
||||
use std::hash::Hasher;
|
||||
let mut hasher = DefaultHasher::new();
|
||||
hasher.write_u64(self.0);
|
||||
|
||||
Reference in New Issue
Block a user