From 045c300324fb580224f866bebd569a8621d8f8c4 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Mon, 11 Nov 2024 11:19:30 +0100 Subject: [PATCH] refactor: replace `instant` with `web-time` See https://rustsec.org/advisories/RUSTSEC-2024-0384.html . --- datafusion-cli/Cargo.lock | 24 +++++++++++------------- datafusion/common/Cargo.toml | 2 +- datafusion/common/src/instant.rs | 4 ++-- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/datafusion-cli/Cargo.lock b/datafusion-cli/Cargo.lock index 9983e247f9ac..b4d790ebb0f3 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.toml index 0747672a18f6..c398fe97d2a4 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.rs index 6401bc29c942..42f21c061c0c 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"))]