Skip to content

Commit 40d8c39

Browse files
committed
Merge branch '0.5'
2 parents da2f7fa + 7a23f3e commit 40d8c39

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).
88

99
You may also find the [Update Guide](UPDATING.md) useful.
1010

11+
## [0.5.4] - 2018-07-11
12+
### Platform support
13+
- Make `OsRng` work via WASM/stdweb for WebWorkers
14+
1115
## [0.5.3] - 2018-06-26
1216
### Platform support
1317
- OpenBSD, Bitrig: fix compilation (broken in 0.5.1) (#530)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rand"
3-
version = "0.5.3" # NB: When modifying, also modify html_root_url in lib.rs
3+
version = "0.5.4" # NB: When modifying, also modify html_root_url in lib.rs
44
authors = ["The Rust Project Developers"]
55
license = "MIT/Apache-2.0"
66
readme = "README.md"

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218

219219
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
220220
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
221-
html_root_url = "https://docs.rs/rand/0.5.3")]
221+
html_root_url = "https://docs.rs/rand/0.5.4")]
222222

223223
#![deny(missing_docs)]
224224
#![deny(missing_debug_implementations)]

src/rngs/os.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,9 @@ mod imp {
10231023
let result = js! {
10241024
try {
10251025
if (
1026-
typeof window === "object" &&
1027-
typeof window.crypto === "object" &&
1028-
typeof window.crypto.getRandomValues === "function"
1026+
typeof self === "object" &&
1027+
typeof self.crypto === "object" &&
1028+
typeof self.crypto.getRandomValues === "function"
10291029
) {
10301030
return { success: true, ty: 1 };
10311031
}
@@ -1063,7 +1063,7 @@ mod imp {
10631063
OsRngMethod::Browser => js! {
10641064
try {
10651065
let array = new Uint8Array(@{ len });
1066-
window.crypto.getRandomValues(array);
1066+
self.crypto.getRandomValues(array);
10671067
HEAPU8.set(array, @{ ptr });
10681068

10691069
return { success: true };

src/seq.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#[cfg(feature="std")] use std::collections::HashMap;
2222
#[cfg(all(feature="alloc", not(feature="std")))] use alloc::collections::BTreeMap;
2323

24-
2524
use super::Rng;
2625
#[cfg(feature="alloc")] use distributions::uniform::{SampleUniform, SampleBorrow};
2726

0 commit comments

Comments
 (0)