diff options
author | 2022-01-28 17:05:09 +0700 | |
---|---|---|
committer | 2022-01-28 21:37:16 +0700 | |
commit | 87b3e03d187237f665b376018ea5af0cc5f05814 (patch) | |
tree | 71509d53f85ed76b1ad2d187652d818230618767 /src/time.rs | |
parent | 776724162aa4351310de9f88c7bb8d61b0abca04 (diff) | |
download | iced-87b3e03d187237f665b376018ea5af0cc5f05814.tar.gz iced-87b3e03d187237f665b376018ea5af0cc5f05814.tar.bz2 iced-87b3e03d187237f665b376018ea5af0cc5f05814.zip |
Enable `instant` only for `wasm32` targets
... and hide the dependency under a `time` module in `iced_native`
Diffstat (limited to '')
-rw-r--r-- | src/time.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/time.rs b/src/time.rs index b8432895..943aa42f 100644 --- a/src/time.rs +++ b/src/time.rs @@ -1,12 +1,12 @@ //! Listen and react to time. +pub use crate::runtime::time::{Duration, Instant}; + use crate::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( - duration: std::time::Duration, -) -> Subscription<std::time::Instant> { +pub fn every(duration: Duration) -> Subscription<Instant> { iced_futures::time::every(duration) } |