Skip to content

Commit 0a3c38d

Browse files
authored
Merge pull request #329 from pitdicker/deprecate_unseeded
Deprecate `new_unseeded` functions
2 parents efa3c3e + 1991ca2 commit 0a3c38d

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/prng/chacha.rs

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ impl ChaChaRng {
121121
///
122122
/// - 2917185654
123123
/// - 2419978656
124+
#[deprecated(since="0.5.0", note="use the NewRng or SeedableRng trait")]
124125
pub fn new_unseeded() -> ChaChaRng {
125126
ChaChaRng::from_seed([0; SEED_WORDS*4])
126127
}

src/prng/isaac.rs

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ impl fmt::Debug for IsaacRng {
121121
impl IsaacRng {
122122
/// Create an ISAAC random number generator using the default
123123
/// fixed seed.
124+
///
125+
/// DEPRECATED. `IsaacRng::new_from_u64(0)` will produce identical results.
126+
#[deprecated(since="0.5.0", note="use the NewRng or SeedableRng trait")]
124127
pub fn new_unseeded() -> IsaacRng {
125128
Self::new_from_u64(0)
126129
}

src/prng/isaac64.rs

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ impl fmt::Debug for Isaac64Rng {
107107
impl Isaac64Rng {
108108
/// Create a 64-bit ISAAC random number generator using the
109109
/// default fixed seed.
110+
///
111+
/// DEPRECATED. `Isaac64Rng::new_from_u64(0)` will produce identical results.
112+
#[deprecated(since="0.5.0", note="use the NewRng or SeedableRng trait")]
110113
pub fn new_unseeded() -> Isaac64Rng {
111114
Self::new_from_u64(0)
112115
}

src/prng/xorshift.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ impl XorShiftRng {
4747
/// by this function will yield the same stream of random numbers. It is
4848
/// highly recommended that this is created through `SeedableRng` instead of
4949
/// this function
50+
#[deprecated(since="0.5.0", note="use the NewRng or SeedableRng trait")]
5051
pub fn new_unseeded() -> XorShiftRng {
5152
XorShiftRng {
5253
x: w(0x193a6754),

0 commit comments

Comments
 (0)