Skip to content

Commit a8618f1

Browse files
authored
Merge pull request #422 from pitdicker/undeprecate_random
Undeprecate random
2 parents 8de2c98 + a2a903c commit a8618f1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/thread_rng.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,15 @@ impl RngCore for ThreadRng {
120120

121121
impl CryptoRng for ThreadRng {}
122122

123-
/// DEPRECATED: use `thread_rng().gen()` instead.
124-
///
125123
/// Generates a random value using the thread-local random number generator.
126124
///
127125
/// This is simply a shortcut for `thread_rng().gen()`. See [`thread_rng`] for
128-
/// documentation of the entropy source and [`Rand`] for documentation of
126+
/// documentation of the entropy source and [`Standard`] for documentation of
129127
/// distributions and type-specific generation.
130128
///
131129
/// # Examples
132130
///
133-
/// ```
134-
/// # #![allow(deprecated)]
131+
/// ```rust
135132
/// let x = rand::random::<u8>();
136133
/// println!("{}", x);
137134
///
@@ -146,7 +143,7 @@ impl CryptoRng for ThreadRng {}
146143
/// If you're calling `random()` in a loop, caching the generator as in the
147144
/// following example can increase performance.
148145
///
149-
/// ```
146+
/// ```rust
150147
/// # #![allow(deprecated)]
151148
/// use rand::Rng;
152149
///
@@ -166,8 +163,7 @@ impl CryptoRng for ThreadRng {}
166163
/// ```
167164
///
168165
/// [`thread_rng`]: fn.thread_rng.html
169-
/// [`Rand`]: trait.Rand.html
170-
#[deprecated(since="0.5.0", note="removed in favor of thread_rng().gen()")]
166+
/// [`Standard`]: distributions/struct.Standard.html
171167
#[inline]
172168
pub fn random<T>() -> T where Standard: Distribution<T> {
173169
thread_rng().gen()

0 commit comments

Comments
 (0)