Skip to content

Commit af751df

Browse files
authored
Merge branch 'master' into work
2 parents 564a504 + 8a07c93 commit af751df

25 files changed

+46
-32
lines changed

CHANGELOG.md

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

99
You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful.
1010

11-
## [Unreleased]
11+
## [0.8.4] - 2021-06-15
1212
### Additions
1313
- Use const-generics to support arrays of all sizes (#1104)
1414
- Implement `Clone` and `Copy` for `Alphanumeric` (#1126)
1515
- Add `Distribution::map` to derive a distribution using a closure (#1129)
16+
- Add `Slice` distribution (#1107)
17+
- Add `DistString` trait with impls for `Standard` and `Alphanumeric` (#1133)
1618

1719
### Other
1820
- Reorder asserts in `Uniform` float distributions for easier debugging of non-finite arguments
1921
(#1094, #1108)
2022
- Add range overflow check in `Uniform` float distributions (#1108)
21-
22-
### Distributions
23-
- Add slice distribution (#1107)
23+
- Deprecate `rngs::adapter::ReadRng` (#1130)
2424

2525
## [0.8.3] - 2021-01-25
2626
### Fixes
@@ -678,4 +678,4 @@ when updating from `rand 0.7.0` without also updating `rand_core`.
678678

679679
## [0.10-pre] - 2014-03-02
680680
### Added
681-
- Seperate `rand` out of the standard library
681+
- Separate `rand` out of the standard library

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.8.3"
3+
version = "0.8.4"
44
authors = ["The Rand Project Developers", "The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ unavailable.
143143

144144
The WASM target `wasm32-unknown-unknown` is not *automatically* supported by
145145
`rand` or `getrandom`. To solve this, either use a different target such as
146-
`wasm32-wasi` or add a direct dependancy on `getrandom` with the `js` feature
146+
`wasm32-wasi` or add a direct dependency on `getrandom` with the `js` feature
147147
(if the target supports JavaScript). See
148148
[getrandom#WebAssembly support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support).
149149

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ No binding guarantees can be provided.
88
## Security premises
99

1010
Rand provides the trait `rand_core::CryptoRng` aka `rand::CryptoRng` as a marker
11-
trait. Generators implementating `RngCore` *and* `CryptoRng`, and given the
11+
trait. Generators implementing `RngCore` *and* `CryptoRng`, and given the
1212
additional constraints that:
1313

1414
- Instances of seedable RNGs (those implementing `SeedableRng`) are

rand_core/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ 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.6.3] - 2021-06-15
8+
### Changed
9+
- Improved bound for `serde` impls on `BlockRng` (#1130)
10+
- Minor doc additions (#1118)
11+
712
## [0.6.2] - 2021-02-12
813
### Fixed
914
- Fixed assertions in `le::read_u32_into` and `le::read_u64_into` which could

rand_core/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_core"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["The Rand Project Developers", "The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

rand_core/src/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub trait BlockRngCore {
9595
/// [`fill_bytes`] / [`try_fill_bytes`] is called on a large array. These methods
9696
/// also handle the bookkeeping of when to generate a new batch of values.
9797
///
98-
/// No whole generated `u32` values are thown away and all values are consumed
98+
/// No whole generated `u32` values are thrown away and all values are consumed
9999
/// in-order. [`next_u32`] simply takes the next available `u32` value.
100100
/// [`next_u64`] is implemented by combining two `u32` values, least
101101
/// significant first. [`fill_bytes`] and [`try_fill_bytes`] consume a whole

rand_distr/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ 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-
## Unreleased
7+
## [0.4.1] - 2021-06-15
8+
- Empirically test PDF of normal distribution (#1121)
89
- Correctly document `no_std` support (#1100)
910
- Add `std_math` feature to prefer `std` over `libm` for floating point math (#1100)
1011
- Add mean and std_dev accessors to Normal (#1114)
1112
- Make sure all distributions and their error types implement `Error`, `Display`, `Clone`,
1213
`Copy`, `PartialEq` and `Eq` as appropriate (#1126)
14+
- Port benchmarks to use Criterion crate (#1116)
1315
- Support serde for distributions (#1141)
1416

1517
## [0.4.0] - 2020-12-18

rand_distr/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_distr"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

rand_distr/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ contrast, this `rand_distr` crate focuses on sampling from distributions.
2424

2525
The floating point functions from `num_traits` and `libm` are used to support
2626
`no_std` environments and ensure reproducibility. If the floating point
27-
functions from `std` are prefered, which may provide better accuracy and
27+
functions from `std` are preferred, which may provide better accuracy and
2828
performance but may produce different random values, the `std_math` feature
2929
can be enabled.
3030

rand_distr/src/binomial.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl Distribution<u64> for Binomial {
106106
// random variate generation. Commun. ACM 31, 2 (February 1988),
107107
// 216-222. http://dx.doi.org/10.1145/42372.42381
108108

109-
// Threshold for prefering the BINV algorithm. The paper suggests 10,
109+
// Threshold for preferring the BINV algorithm. The paper suggests 10,
110110
// Ranlib uses 30, and GSL uses 14.
111111
const BINV_THRESHOLD: f64 = 10.;
112112

@@ -243,7 +243,7 @@ impl Distribution<u64> for Binomial {
243243
}
244244
}
245245

246-
// Step 5.2: Squeezing. Check the value of ln(v) againts upper and
246+
// Step 5.2: Squeezing. Check the value of ln(v) against upper and
247247
// lower bound of ln(f(y)).
248248
let k = k as f64;
249249
let rho = (k / npq) * ((k * (k / 3. + 0.625) + 1. / 6.) / npq + 0.5);

rand_distr/src/hypergeometric.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ enum SamplingMethod {
3030
/// `f(k) = binomial(K, k) * binomial(N-K, n-k) / binomial(N, n)`,
3131
/// where `binomial(a, b) = a! / (b! * (a - b)!)`.
3232
///
33-
/// The [binomial distribution](crate::Binomial) is the analagous distribution
33+
/// The [binomial distribution](crate::Binomial) is the analogous distribution
3434
/// for sampling with replacement. It is a good approximation when the population
3535
/// size is much larger than the sample size.
3636
///

rand_distr/src/poisson.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ where F: Float + FloatConst, Standard: Distribution<F>
110110
loop {
111111
// draw from the Cauchy distribution
112112
comp_dev = rng.sample(cauchy);
113-
// shift the peak of the comparison ditribution
113+
// shift the peak of the comparison distribution
114114
result = self.sqrt_2lambda * comp_dev + self.lambda;
115115
// repeat the drawing until we are in the range of possible values
116116
if result >= F::zero() {

rand_distr/src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ where
9191
let i = bits as usize & 0xff;
9292

9393
let u = if symmetric {
94-
// Convert to a value in the range [2,4) and substract to get [-1,1)
94+
// Convert to a value in the range [2,4) and subtract to get [-1,1)
9595
// We can't convert to an open range directly, that would require
96-
// substracting `3.0 - EPSILON`, which is not representable.
96+
// subtracting `3.0 - EPSILON`, which is not representable.
9797
// It is possible with an extra step, but an open range does not
98-
// seem neccesary for the ziggurat algorithm anyway.
98+
// seem necessary for the ziggurat algorithm anyway.
9999
(bits >> 12).into_float_with_exponent(1) - 3.0
100100
} else {
101-
// Convert to a value in the range [1,2) and substract to get (0,1)
101+
// Convert to a value in the range [1,2) and subtract to get (0,1)
102102
(bits >> 12).into_float_with_exponent(0) - (1.0 - core::f64::EPSILON / 2.0)
103103
};
104104
let x = u * x_tab[i];

rand_hc/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ 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.3.1] - 2021-06-15
8+
- Adjust crate links
9+
710
## [0.3.0] - 2020-12-08
811
- Bump `rand_core` version to 0.6.0
912
- Bump MSRV to 1.36 (#1011)

rand_hc/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_hc"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

rand_hc/src/hc128.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl BlockRngCore for Hc128Core {
142142
let dd = (cc + 16) % 512;
143143
let ee = cc.wrapping_sub(16) % 512;
144144
// These asserts let the compiler optimize out the bounds checks.
145-
// Some of them may be superflous, and that's fine:
145+
// Some of them may be superfluous, and that's fine:
146146
// they'll be optimized out if that's the case.
147147
assert!(ee + 15 < 512);
148148
assert!(cc + 15 < 512);
@@ -238,7 +238,7 @@ impl Hc128Core {
238238
let dd = (cc + 16) % 512;
239239
let ee = cc.wrapping_sub(16) % 512;
240240
// These asserts let the compiler optimize out the bounds checks.
241-
// Some of them may be superflous, and that's fine:
241+
// Some of them may be superfluous, and that's fine:
242242
// they'll be optimized out if that's the case.
243243
assert!(ee + 15 < 512);
244244
assert!(cc + 15 < 512);

rand_pcg/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ 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.3.1] - 2021-06-15
8+
- Add `advance` methods to RNGs (#1111)
9+
- Document dependencies between streams (#1122)
10+
711
## [0.3.0] - 2020-12-08
812
- Bump `rand_core` version to 0.6.0
913
- Bump MSRV to 1.36 (#1011)

rand_pcg/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_pcg"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

rand_pcg/src/pcg128.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl Lcg128Xsl64 {
9393
#[inline]
9494
fn from_state_incr(state: u128, increment: u128) -> Self {
9595
let mut pcg = Lcg128Xsl64 { state, increment };
96-
// Move away from inital value:
96+
// Move away from initial value:
9797
pcg.state = pcg.state.wrapping_add(pcg.increment);
9898
pcg.step();
9999
pcg

rand_pcg/src/pcg64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Lcg64Xsh32 {
9494
#[inline]
9595
fn from_state_incr(state: u64, increment: u64) -> Self {
9696
let mut pcg = Lcg64Xsh32 { state, increment };
97-
// Move away from inital value:
97+
// Move away from initial value:
9898
pcg.state = pcg.state.wrapping_add(pcg.increment);
9999
pcg.step();
100100
pcg

src/distributions/bernoulli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct Bernoulli {
4949
// `f64` only has 53 bits of precision, and the next largest value of `p` will
5050
// result in `2^64 - 2048`.
5151
//
52-
// Also there is a 100% theoretical concern: if someone consistenly wants to
52+
// Also there is a 100% theoretical concern: if someone consistently wants to
5353
// generate `true` using the Bernoulli distribution (i.e. by using a probability
5454
// of `1.0`), just using `u64::MAX` is not enough. On average it would return
5555
// false once every 2^64 iterations. Some people apparently care about this

src/distributions/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub struct Open01;
7878
pub trait IntoFloat {
7979
type F;
8080

81-
/// Helper method to combine the fraction and a contant exponent into a
81+
/// Helper method to combine the fraction and a constant exponent into a
8282
/// float.
8383
///
8484
/// Only the least significant bits of `self` may be set, 23 for `f32` and

src/distributions/uniform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ use serde::{Serialize, Deserialize};
158158
/// println!("{}", sum);
159159
/// ```
160160
///
161-
/// For a single sample, [`Rng::gen_range`] may be prefered:
161+
/// For a single sample, [`Rng::gen_range`] may be preferred:
162162
///
163163
/// ```
164164
/// use rand::Rng;

src/rngs/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::{CryptoRng, Error, RngCore, SeedableRng};
3333

3434

3535
// Number of generated bytes after which to reseed `ThreadRng`.
36-
// According to benchmarks, reseeding has a noticable impact with thresholds
36+
// According to benchmarks, reseeding has a noticeable impact with thresholds
3737
// of 32 kB and less. We choose 64 kB to avoid significant overhead.
3838
const THREAD_RNG_RESEED_THRESHOLD: u64 = 1024 * 64;
3939

@@ -59,7 +59,7 @@ const THREAD_RNG_RESEED_THRESHOLD: u64 = 1024 * 64;
5959
#[cfg_attr(doc_cfg, doc(cfg(all(feature = "std", feature = "std_rng"))))]
6060
#[derive(Clone, Debug)]
6161
pub struct ThreadRng {
62-
// Rc is explictly !Send and !Sync
62+
// Rc is explicitly !Send and !Sync
6363
rng: Rc<UnsafeCell<ReseedingRng<Core, OsRng>>>,
6464
}
6565

0 commit comments

Comments
 (0)