diff options
| author | 2023-03-05 04:15:10 +0100 | |
|---|---|---|
| committer | 2023-03-05 04:15:10 +0100 | |
| commit | f4cf488e0b083b5d7b7612c650917233163ee9cb (patch) | |
| tree | 66b7ebdbf6896f472c927d0f0d9fc02bdc5c5f83 /futures/src/backend/native/smol.rs | |
| parent | 5fed065dc3aa3d2f9ff8d229cbffe003a89ba033 (diff) | |
| download | iced-f4cf488e0b083b5d7b7612c650917233163ee9cb.tar.gz iced-f4cf488e0b083b5d7b7612c650917233163ee9cb.tar.bz2 iced-f4cf488e0b083b5d7b7612c650917233163ee9cb.zip | |
Remove generic `Hasher` and `Event` from `subscription::Recipe`
Diffstat (limited to 'futures/src/backend/native/smol.rs')
| -rw-r--r-- | futures/src/backend/native/smol.rs | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/futures/src/backend/native/smol.rs b/futures/src/backend/native/smol.rs index d5201cde..30bc8291 100644 --- a/futures/src/backend/native/smol.rs +++ b/futures/src/backend/native/smol.rs @@ -19,28 +19,26 @@ impl crate::Executor for Executor {  pub mod time {      //! Listen and react to time. +    use crate::core::Hasher;      use crate::subscription::{self, Subscription};      /// Returns a [`Subscription`] that produces messages at a set interval.      ///      /// The first message is produced after a `duration`, and then continues to      /// produce more messages every `duration` after that. -    pub fn every<H: std::hash::Hasher, E>( +    pub fn every(          duration: std::time::Duration, -    ) -> Subscription<H, E, std::time::Instant> { +    ) -> Subscription<std::time::Instant> {          Subscription::from_recipe(Every(duration))      }      #[derive(Debug)]      struct Every(std::time::Duration); -    impl<H, E> subscription::Recipe<H, E> for Every -    where -        H: std::hash::Hasher, -    { +    impl subscription::Recipe for Every {          type Output = std::time::Instant; -        fn hash(&self, state: &mut H) { +        fn hash(&self, state: &mut Hasher) {              use std::hash::Hash;              std::any::TypeId::of::<Self>().hash(state); @@ -49,7 +47,7 @@ pub mod time {          fn stream(              self: Box<Self>, -            _input: futures::stream::BoxStream<'static, E>, +            _input: subscription::EventStream,          ) -> futures::stream::BoxStream<'static, Self::Output> {              use futures::stream::StreamExt; | 
