Apache DataFusion SQL Query Engine
refactor: replace `instant` with `web-time` (#13355)
Marco Neumann5309d83e31ed
diff --git a/datafusion-cli/Cargo.lock b/datafusion-cli/Cargo.lockindex 9983e247f9..b4d790ebb0 100644--- a/datafusion-cli/Cargo.lock+++ b/datafusion-cli/Cargo.lock@@ -1300,7 +1300,6 @@ dependencies = ["half","hashbrown 0.14.5","indexmap",- "instant","libc","num_cpus","object_store",@@ -1308,6 +1307,7 @@ dependencies = ["paste","sqlparser","tokio",+ "web-time",][[package]]@@ -2354,18 +2354,6 @@ dependencies = ["hashbrown 0.15.1",]-[[package]]-name = "instant"-version = "0.1.13"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"-dependencies = [- "cfg-if",- "js-sys",- "wasm-bindgen",- "web-sys",-]-[[package]]name = "integer-encoding"version = "3.0.4"@@ -4275,6 +4263,16 @@ dependencies = ["wasm-bindgen",]+[[package]]+name = "web-time"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"+dependencies = [+ "js-sys",+ "wasm-bindgen",+]+[[package]]name = "winapi-util"version = "0.1.9"diff --git a/datafusion/common/Cargo.toml b/datafusion/common/Cargo.tomlindex 0747672a18..c398fe97d2 100644--- a/datafusion/common/Cargo.toml+++ b/datafusion/common/Cargo.toml@@ -67,7 +67,7 @@ sqlparser = { workspace = true }tokio = { workspace = true }[target.'cfg(target_family = "wasm")'.dependencies]-instant = { version = "0.1", features = ["wasm-bindgen"] }+web-time = "1.1.0"[dev-dependencies]rand = { workspace = true }diff --git a/datafusion/common/src/instant.rs b/datafusion/common/src/instant.rsindex 6401bc29c9..42f21c061c 100644--- a/datafusion/common/src/instant.rs+++ b/datafusion/common/src/instant.rs@@ -18,9 +18,9 @@//! WASM-compatible `Instant` wrapper.#[cfg(target_family = "wasm")]-/// DataFusion wrapper around [`std::time::Instant`]. Uses [`instant::Instant`]+/// DataFusion wrapper around [`std::time::Instant`]. Uses [`web_time::Instant`]/// under `wasm` feature gate. It provides the same API as [`std::time::Instant`].-pub type Instant = instant::Instant;+pub type Instant = web_time::Instant;#[allow(clippy::disallowed_types)]#[cfg(not(target_family = "wasm"))]