From 83c649b574d90667d23c8430baaebcd0ef933055 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jan 2022 17:20:40 +0700 Subject: Move `time` module from `iced_native` to `iced_core` --- core/src/lib.rs | 1 + core/src/time.rs | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 core/src/time.rs (limited to 'core/src') diff --git a/core/src/lib.rs b/core/src/lib.rs index b76c6d20..2a4e6158 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -17,6 +17,7 @@ pub mod alignment; pub mod keyboard; pub mod mouse; +pub mod time; mod background; mod color; diff --git a/core/src/time.rs b/core/src/time.rs new file mode 100644 index 00000000..5f95ee86 --- /dev/null +++ b/core/src/time.rs @@ -0,0 +1,7 @@ +//! Keep track of time, both in native and web platforms! + +#[cfg(target_arch = "wasm32")] +pub use instant::{Duration, Instant}; + +#[cfg(not(target_arch = "wasm32"))] +pub use std::time::{Duration, Instant}; -- cgit From e730d97f61bc2edc77d2f061b6a763c4d0a948df Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jan 2022 18:43:20 +0700 Subject: Implement `time` module for `wasm-bindgen` backend in `iced_futures` --- core/src/time.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/src') diff --git a/core/src/time.rs b/core/src/time.rs index 5f95ee86..f496d1a4 100644 --- a/core/src/time.rs +++ b/core/src/time.rs @@ -1,7 +1,9 @@ //! Keep track of time, both in native and web platforms! #[cfg(target_arch = "wasm32")] -pub use instant::{Duration, Instant}; +pub use wasm_timer::Instant; #[cfg(not(target_arch = "wasm32"))] -pub use std::time::{Duration, Instant}; +pub use std::time::Instant; + +pub use std::time::Duration; -- cgit