Skip to content

Commit e0ae07a

Browse files
committed
Update dependencies
1 parent b96a7d6 commit e0ae07a

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

src/update-0.5.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ any type supporting `SeedableRng`, and provides construction from fresh, strong
7575
entropy:
7676

7777
```rust,noplayground
78-
use rand_0_5::{ChaChaRng, FromEntropy};
78+
# extern crate rand_0_5 as rand;
79+
use rand::{ChaChaRng, FromEntropy};
7980
8081
let mut rng = ChaChaRng::from_entropy();
8182
```
@@ -121,7 +122,8 @@ A new `Error` type has been added, designed explicitly for no-std compatibility,
121122
simplicity, and enough flexibility for our uses (carrying a `cause` when
122123
possible):
123124
```rust,noplayground
124-
# use rand_0_5::ErrorKind;
125+
# extern crate rand_0_5 as rand;
126+
# use rand::ErrorKind;
125127
pub struct Error {
126128
pub kind: ErrorKind,
127129
pub msg: &'static str,
@@ -183,8 +185,9 @@ The method `ChaChaRng::set_counter` has been replaced by two new methods,
183185
method may be emulated as follows:
184186

185187
```rust,noplayground
188+
# extern crate rand_0_5 as rand;
186189
# use rand::prelude::*;
187-
# use rand_chacha::ChaChaRng;
190+
# use rand_chacha_0_1::ChaChaRng;
188191
# fn main() {
189192
let lower = 88293;
190193
let higher = 9300932;

src/update-0.8.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ let b: u32 = Standard.sample_iter(rng).next().unwrap();
5353
```
5454
can be replaced with the following code:
5555
```rust,noplayground
56-
# use rand_0_8::prelude::*;
57-
# use rand_0_8::distributions::Standard;
56+
# extern crate rand_0_8 as rand;
57+
# use rand::prelude::*;
58+
# use rand::distributions::Standard;
5859
# fn main () {
5960
let mut rng = thread_rng();
6061
let a: u32 = Standard.sample_iter(&mut rng).next().unwrap();
@@ -130,10 +131,10 @@ Several smaller changes occurred to rand distributions:
130131
```
131132
With Rand 0.8, this is equivalent to the following:
132133
```rust,noplayground
133-
# extern crate rand;
134-
# use rand_0_8::{distributions::Alphanumeric, Rng};
134+
# extern crate rand_0_8 as rand;
135+
# use rand::{distributions::Alphanumeric, Rng};
135136
# fn main() {
136-
# let mut rng = rand_0_8::thread_rng();
137+
# let mut rng = rand::thread_rng();
137138
let chars: String = std::iter::repeat(())
138139
.map(|()| rng.sample(Alphanumeric))
139140
.map(char::from)

tests/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ publish = false
66

77
[dependencies]
88
doc-comment = "0.3.3"
9-
rand = { version = "0.9" }
9+
rand = { version = "0.10", features = ["chacha"] }
1010
rand_0_8 = { package = "rand", version = "0.8", features = ["small_rng"] }
1111
rand_0_7 = { package = "rand", version = "0.7" }
1212
rand_0_5 = { package = "rand", version = "0.5" }
13-
rand_pcg = { version = "0.9" }
14-
rand_chacha = { version = "0.9" }
13+
rand_pcg = { version = "0.10" }
14+
rand_chacha_0_1 = { package = "rand_chacha", version = "0.1" }
1515
rand_distr = { version = "0.5" }
1616
rand_distr_0_4 = { package = "rand_distr", version = "0.4" }
1717
rand_distr_0_2 = { package = "rand_distr", version = "0.2" }
18-
rand_seeder = { version = "0.4" }
18+
rand_seeder = { version = "0.5" }
1919
rayon = "1.5.3"

0 commit comments

Comments
 (0)