Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-random/getrandom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1531b48ef61514d55244cac90a7e4d90a6e49d2d
Choose a base ref
..
head repository: rust-random/getrandom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b7e5df8c92e8443b86e9eb76fbebb8c2101cb727
Choose a head ref
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/wasm32_bindgen.rs
2 changes: 2 additions & 0 deletions src/wasm32_bindgen.rs
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ enum RngSource {
Browser(BrowserCrypto),
}

// JsValues are always per-thread, so we initialize RngSource for each thread.
// See: https://github.com/rustwasm/wasm-bindgen/pull/955
thread_local!(
static RNG_SOURCE: RefCell<Option<RngSource>> = RefCell::new(None);
);