diff options
author | 2022-01-28 18:43:20 +0700 | |
---|---|---|
committer | 2022-01-28 21:37:17 +0700 | |
commit | e730d97f61bc2edc77d2f061b6a763c4d0a948df (patch) | |
tree | 8966e2ad3b093c83295b3ad0c5b8d1c460a1c158 /core | |
parent | 167be45a7db7c1f60a79116766bdf38300429c6a (diff) | |
download | iced-e730d97f61bc2edc77d2f061b6a763c4d0a948df.tar.gz iced-e730d97f61bc2edc77d2f061b6a763c4d0a948df.tar.bz2 iced-e730d97f61bc2edc77d2f061b6a763c4d0a948df.zip |
Implement `time` module for `wasm-bindgen` backend in `iced_futures`
Diffstat (limited to 'core')
-rw-r--r-- | core/Cargo.toml | 5 | ||||
-rw-r--r-- | core/src/time.rs | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index 83458ac0..dde34326 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -14,6 +14,5 @@ bitflags = "1.2" version = "0.5" optional = true -[target.'cfg(target_arch = "wasm32")'.dependencies.instant] -version = "0.1" -features = ["wasm-bindgen"] +[target.'cfg(target_arch = "wasm32")'.dependencies] +wasm-timer = { version = "0.2" } 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; |