Skip to content

Commit b526344

Browse files
authored
Fix compiler error on wasm with deault features. (#129)
* Fix compiler error on wasm.
1 parent 24491f6 commit b526344

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ jobs:
148148
- uses: actions-rs/cargo@v1
149149
with:
150150
command: check
151-
args: --target wasm32-unknown-unknown --no-default-features
151+
args: --target wasm32-unknown-unknown

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,18 @@ codegen-units = 1
6868
version_check = "0.9.4"
6969

7070
[dependencies]
71-
getrandom = { version = "0.2.3", optional = true }
7271
const-random = { version = "0.1.12", optional = true }
7372
serde = { version = "1.0.117", optional = true }
7473
cfg-if = "1.0"
7574

75+
[target."cfg(not(any(target_arch = \"wasm32\", target_abi = \"unknown\")))".dependencies.getrandom]
76+
version = "0.2.7"
77+
optional = true
78+
79+
[target."cfg(any(target_arch = \"wasm32\", target_abi = \"unknown\"))".dependencies.getrandom]
80+
version = "0.2.7"
81+
features = ["js"]
82+
7683
[target.'cfg(not(all(target_arch = "arm", target_os = "none")))'.dependencies]
7784
once_cell = { version = "1.8", default-features = false, features = ["unstable", "alloc"] }
7885

0 commit comments

Comments
 (0)