Skip to content

Commit

Permalink
Add web-time
Browse files Browse the repository at this point in the history
  • Loading branch information
misssonder committed Aug 5, 2024
1 parent 614f8f0 commit 4a16276
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ no_std = ["no-std-compat", "num-traits/libm", "core-error", "libm", "hashbrown",
#! ### JavaScript Interface for WASM

## Use [`wasm-bindgen`](https://crates.io/crates/wasm-bindgen) as JavaScript interface.
wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"]
wasm-bindgen = ["getrandom/js"]
## Use [`stdweb`](https://crates.io/crates/stdweb) as JavaScript interface.
stdweb = ["getrandom/js", "instant/stdweb"]
stdweb = ["getrandom/js"]

#! ### Features used in testing environments only

Expand Down Expand Up @@ -156,7 +156,7 @@ codegen-units = 1
#panic = 'abort' # remove stack backtrace for no-std

[target.'cfg(target_family = "wasm")'.dependencies]
instant = { version = "0.1.10" } # WASM implementation of std::time::Instant
web-time = { version = "1.1.0" }# WASM implementation of std::time::Instant

[package.metadata.docs.rs]
features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging"]
Expand Down
2 changes: 1 addition & 1 deletion src/packages/time_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::FLOAT;
use std::time::{Duration, Instant};

#[cfg(all(target_family = "wasm", target_os = "unknown"))]
use instant::{Duration, Instant};
use web_time::{Duration, Instant};

def_package! {
/// Package of basic timing utilities.
Expand Down
2 changes: 1 addition & 1 deletion src/types/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use std::time::Instant;

#[cfg(not(feature = "no_time"))]
#[cfg(all(target_family = "wasm", target_os = "unknown"))]
pub use instant::Instant;
pub use web_time::Instant;

#[cfg(not(feature = "no_index"))]
use crate::{Array, Blob};
Expand Down

0 comments on commit 4a16276

Please sign in to comment.