File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ pub trait Rng: RngCore {
73
73
/// generated.
74
74
///
75
75
/// For arrays of integers, especially for those with small element types
76
- /// (< 64 bit), it will likely be faster to instead use [`Rng::fill`].
76
+ /// (< 64 bit), it will likely be faster to instead use [`Rng::fill`],
77
+ /// though note that generated values will differ.
77
78
///
78
79
/// ```
79
80
/// use rand::{thread_rng, Rng};
@@ -223,6 +224,10 @@ pub trait Rng: RngCore {
223
224
224
225
/// Fill any type implementing [`Fill`] with random data
225
226
///
227
+ /// This method is implemented for types which may be safely reinterpreted
228
+ /// as an (aligned) `[u8]` slice then filled with random data. It is often
229
+ /// faster than using [`Rng::random`] but not value-equivalent.
230
+ ///
226
231
/// The distribution is expected to be uniform with portable results, but
227
232
/// this cannot be guaranteed for third-party implementations.
228
233
///
You can’t perform that action at this time.
0 commit comments