From 87b3e03d187237f665b376018ea5af0cc5f05814 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jan 2022 17:05:09 +0700 Subject: Enable `instant` only for `wasm32` targets ... and hide the dependency under a `time` module in `iced_native` --- src/time.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 { +pub fn every(duration: Duration) -> Subscription { iced_futures::time::every(duration) } -- cgit