Skip to content

Commit

Permalink
chore: getrandom bump
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Feb 27, 2025
1 parent 5ba883a commit 46f410a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 24 deletions.
62 changes: 43 additions & 19 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions stremio-core-web/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build]

rustdocflags = ["--cfg", "docsrs", "-Z", "unstable-options", "--enable-index-page"]
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]

[alias]
# Requires cargo-watch
Expand Down
6 changes: 3 additions & 3 deletions stremio-core-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default = ["std", "wasm"]

std = []
# enable wasm bindings exports, enabled by default (stremio-core-web crate after all)
wasm = ["env", "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:gloo-utils", "dep:tracing-wasm", "dep:console_error_panic_hook", "dep:js-sys", "dep:web-sys", "getrandom?/js"]
wasm = ["env", "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:gloo-utils", "dep:tracing-wasm", "dep:console_error_panic_hook", "dep:js-sys", "dep:web-sys", "getrandom?/wasm_js"]
# Enable's the wasm Env. impl
# (this means that `wasm` feature is a superset of this one)
env = ["dep:http", "dep:regex", "dep:hex", "dep:getrandom", "dep:serde_path_to_error"]
Expand Down Expand Up @@ -43,7 +43,7 @@ itertools = "0.14.*"
boolinator = "2.4.*"

# WASM
wasm-bindgen = { version = "=0.2.78", features = ["serde-serialize"], optional = true }
wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"], optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
gloo-utils = { version = "0.2", features = ["serde"], optional = true }

Expand All @@ -62,7 +62,7 @@ web-sys = { version = "0.3", features = [
"console",
], optional = true }
# for env. impl
getrandom = { version = "0.2", optional = true }
getrandom = { version = "0.3", optional = true }
# for env. impl
serde_path_to_error = { version = "0.1", optional = true }

Expand Down
2 changes: 1 addition & 1 deletion stremio-core-web/rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# version of wasm-bindgen, while the newest wasm-bindgen
# introduces an unknown panic when transpiled using
# wasm2js
channel = "1.77"
channel = "1.85"
2 changes: 1 addition & 1 deletion stremio-core-web/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl WebEnv {
}
pub fn random_buffer(len: usize) -> Vec<u8> {
let mut buffer = vec![0u8; len];
getrandom::getrandom(buffer.as_mut_slice()).expect("generate random buffer failed");
getrandom::fill(buffer.as_mut_slice()).expect("generate random buffer failed");
buffer
}
}
Expand Down

0 comments on commit 46f410a

Please sign in to comment.