Skip to content

Commit

Permalink
Migrate to web_time::SystemTime for wasm32-unknown-unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss committed Nov 28, 2024
1 parent 454d1a8 commit 750a64e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ tzif = { version = "0.2.3", optional = true }
jiff-tzdb = { version = "0.1.1", optional = true }
combine = { version = "4.6.7", optional = true }

# System time feature
web-time = { version = "1.1.0", optional = true }

[features]
log = ["dep:log"]
experimental = ["tzdb"]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
extern crate alloc;
extern crate core;

// TODO: Support SystemTime directly / pull in OS code from std::time?
#[cfg(feature = "std")]
extern crate std;

Expand Down
4 changes: 2 additions & 2 deletions src/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use alloc::string::{String, ToString};

use crate::{TemporalError, TemporalResult};

use std::time::{SystemTime, UNIX_EPOCH};
use web_time::{SystemTime, UNIX_EPOCH};

// TODO: Need to implement system handling for non_std.
// TODO: Need to implement SystemTime handling for non_std.

/// Returns the system time in nanoseconds.
pub(crate) fn get_system_nanoseconds() -> TemporalResult<u128> {
Expand Down

0 comments on commit 750a64e

Please sign in to comment.