diff options
| author | 2024-05-08 19:16:06 +0900 | |
|---|---|---|
| committer | 2024-05-08 19:16:06 +0900 | |
| commit | 477887b3870aa5fbdab96c3a06f3b930462d7842 (patch) | |
| tree | 2b3272bb178f8757169511966589fe6a106733f4 /futures | |
| parent | 0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff) | |
| parent | e07b42ac96b8d098a883c93afe828a439f479c7b (diff) | |
| download | iced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.gz iced-477887b3870aa5fbdab96c3a06f3b930462d7842.tar.bz2 iced-477887b3870aa5fbdab96c3a06f3b930462d7842.zip | |
Merge branch 'master' of https://github.com/iced-rs/iced into iced-rs-master
Diffstat (limited to '')
| -rw-r--r-- | futures/src/backend/native/tokio.rs | 14 | 
1 files changed, 8 insertions, 6 deletions
| diff --git a/futures/src/backend/native/tokio.rs b/futures/src/backend/native/tokio.rs index 3ab7f675..df91d798 100644 --- a/futures/src/backend/native/tokio.rs +++ b/futures/src/backend/native/tokio.rs @@ -55,13 +55,15 @@ pub mod time {              let start = tokio::time::Instant::now() + self.0; +            let mut interval = tokio::time::interval_at(start, self.0); +            interval.set_missed_tick_behavior( +                tokio::time::MissedTickBehavior::Skip, +            ); +              let stream = { -                futures::stream::unfold( -                    tokio::time::interval_at(start, self.0), -                    |mut interval| async move { -                        Some((interval.tick().await, interval)) -                    }, -                ) +                futures::stream::unfold(interval, |mut interval| async move { +                    Some((interval.tick().await, interval)) +                })              };              stream.map(tokio::time::Instant::into_std).boxed() | 
