1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Add painter region as example

This commit is contained in:
Emil Ernerfeldt
2020-04-24 18:32:27 +02:00
parent 7459aa60a4
commit 39e17a7562
7 changed files with 105 additions and 23 deletions

View File

@@ -43,14 +43,14 @@ impl Id {
Self(1)
}
pub fn new<H: Hash>(source: H) -> Id {
pub fn new(source: impl Hash) -> 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(self, child: impl Hash) -> Id {
use std::hash::Hasher;
let mut hasher = DefaultHasher::new();
hasher.write_u64(self.0);