diff options
author | 2022-01-28 17:20:40 +0700 | |
---|---|---|
committer | 2022-01-28 21:37:16 +0700 | |
commit | 83c649b574d90667d23c8430baaebcd0ef933055 (patch) | |
tree | 7fdb5868ff5cb8af51f1efdad7a9f177207348c3 /core | |
parent | 87b3e03d187237f665b376018ea5af0cc5f05814 (diff) | |
download | iced-83c649b574d90667d23c8430baaebcd0ef933055.tar.gz iced-83c649b574d90667d23c8430baaebcd0ef933055.tar.bz2 iced-83c649b574d90667d23c8430baaebcd0ef933055.zip |
Move `time` module from `iced_native` to `iced_core`
Diffstat (limited to 'core')
-rw-r--r-- | core/Cargo.toml | 4 | ||||
-rw-r--r-- | core/src/lib.rs | 1 | ||||
-rw-r--r-- | core/src/time.rs | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index ca28c308..83458ac0 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,3 +13,7 @@ bitflags = "1.2" [dependencies.palette] version = "0.5" optional = true + +[target.'cfg(target_arch = "wasm32")'.dependencies.instant] +version = "0.1" +features = ["wasm-bindgen"] 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}; |