diff options
| author | 2024-05-08 19:16:20 +0900 | |
|---|---|---|
| committer | 2024-05-08 19:16:20 +0900 | |
| commit | ff26fb7df43bd241253af85e0621e2cc030e9cec (patch) | |
| tree | 2b3272bb178f8757169511966589fe6a106733f4 /futures/src/backend | |
| parent | 0ebe0629cef37aee5c48b9409fc36618a3a3e60d (diff) | |
| parent | 477887b3870aa5fbdab96c3a06f3b930462d7842 (diff) | |
| download | iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.gz iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.tar.bz2 iced-ff26fb7df43bd241253af85e0621e2cc030e9cec.zip | |
Merge branch 'iced-rs-master' into viewer_content_fit
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() | 
