From 7a5ab7bbcbcd101f8aae362448fcde2a32fc2dd1 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 20 Mar 2025 12:35:50 +0100 Subject: [PATCH 1/2] Make building with time support on wasm optional --- Cargo.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c8e0e588d..07f90cf90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ serde = { version = "1.0.136", default-features = false, features = ["derive", " serde_json = { version = "1.0.45", default-features = false, features = ["alloc"], optional = true } unicode-xid = { version = "0.2.0", default-features = false, optional = true } rust_decimal = { version = "1.24.0", default-features = false, features = ["maths"], optional = true } -getrandom = { version = "0.2.7", optional = true } rustyline = { version = "15.0.0", optional = true } document-features = { version = "0.2.0", optional = true } arbitrary = { version = "1.3.2", optional = true, features = ["derive"] } @@ -118,9 +117,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 = ["instant/wasm-bindgen"] ## Use [`stdweb`](https://crates.io/crates/stdweb) as JavaScript interface. -stdweb = ["getrandom/js", "instant/stdweb"] +stdweb = ["instant/stdweb"] #! ### Features used in testing environments only @@ -156,7 +155,9 @@ 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 +instant = { version = "0.1.10", optional = true } # WASM implementation of std::time::Instant +getrandom = { version = "0.2.7", features = ["js"] } + [package.metadata.docs.rs] features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging"] From c46577192bfa15b086d6602dbc58928dc94fef92 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 20 Mar 2025 12:40:43 +0100 Subject: [PATCH 2/2] Remove extra new line --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 07f90cf90..815382fea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -158,7 +158,6 @@ codegen-units = 1 instant = { version = "0.1.10", optional = true } # WASM implementation of std::time::Instant getrandom = { version = "0.2.7", features = ["js"] } - [package.metadata.docs.rs] features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging"]