summaryrefslogtreecommitdiffstats
path: root/examples/stopwatch.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-14 02:12:25 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-14 02:12:25 +0100
commit77154869061594706185709d7b79ac520c8a125a (patch)
tree224afaa75521db30e9ab2abd80bf677ada551f54 /examples/stopwatch.rs
parent65ff3744a06ca5bcb2e1682862d49520bf7ccbfe (diff)
downloadiced-77154869061594706185709d7b79ac520c8a125a.tar.gz
iced-77154869061594706185709d7b79ac520c8a125a.tar.bz2
iced-77154869061594706185709d7b79ac520c8a125a.zip
Use generic `Hasher` in `stopwatch`
Diffstat (limited to '')
-rw-r--r--examples/stopwatch.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/stopwatch.rs b/examples/stopwatch.rs
index b902baae..686d239d 100644
--- a/examples/stopwatch.rs
+++ b/examples/stopwatch.rs
@@ -155,12 +155,13 @@ mod time {
struct Every(std::time::Duration);
- impl<Input> iced_native::subscription::Recipe<iced_native::Hasher, Input>
- for Every
+ impl<Hasher, Input> iced_native::subscription::Recipe<Hasher, Input> for Every
+ where
+ Hasher: std::hash::Hasher,
{
type Output = std::time::Instant;
- fn hash(&self, state: &mut iced_native::Hasher) {
+ fn hash(&self, state: &mut Hasher) {
use std::hash::Hash;
std::any::TypeId::of::<Self>().hash(state);