Skip to content

Commit c388cb2

Browse files
authored
Merge pull request #873 from dhardy/master
Fixes regarding OsRng move
2 parents d877ed5 + a622ea3 commit c388cb2

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ members = [
5757
rand_core = { path = "rand_core", version = "0.5" }
5858
rand_pcg = { path = "rand_pcg", version = "0.2", optional = true }
5959
# Do not depend on 'getrandom_package' directly; use the 'getrandom' feature!
60+
# This is a dependency because: we forward wasm feature flags
61+
# This is renamed because: we need getrandom to depend on rand_core/getrandom
6062
getrandom_package = { version = "0.1.1", package = "getrandom", optional = true }
6163
log = { version = "0.4", optional = true }
6264

rand_os/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [0.2.2] - 2019-09-02
7+
## [0.2.2] - 2019-08-28
88
### Changed
99
- `OsRng` added to `rand_core`, rendering this crate deprecated (#863)
1010

src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@
5757
#[cfg(all(feature="alloc", not(feature="std")))]
5858
extern crate alloc;
5959

60-
#[cfg(feature = "getrandom")]
61-
use getrandom_package as getrandom;
62-
6360
#[allow(unused)]
6461
macro_rules! trace { ($($x:tt)*) => (
6562
#[cfg(feature = "log")] {

src/rngs/std.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
1111
use crate::{RngCore, CryptoRng, Error, SeedableRng};
1212

13-
#[cfg(target_os = "emscripten")] pub(crate) use rand_hc::Hc128Core as Core;
14-
#[cfg(not(target_os = "emscripten"))] pub(crate) use rand_chacha::ChaCha20Core as Core;
13+
#[cfg(all(any(test, feature = "std"), target_os = "emscripten"))]
14+
pub(crate) use rand_hc::Hc128Core as Core;
15+
#[cfg(all(any(test, feature = "std"), not(target_os = "emscripten")))]
16+
pub(crate) use rand_chacha::ChaCha20Core as Core;
17+
1518
#[cfg(target_os = "emscripten")] use rand_hc::Hc128Rng as Rng;
1619
#[cfg(not(target_os = "emscripten"))] use rand_chacha::ChaCha20Rng as Rng;
1720

0 commit comments

Comments
 (0)