Skip to content

Commit ed77f12

Browse files
committed
Simplify example for large seeds
1 parent b75cfb5 commit ed77f12

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

rand_core/src/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,13 @@ pub trait SeedableRng: Sized {
297297
/// ```
298298
/// use rand_core::SeedableRng;
299299
///
300-
/// pub struct MyRngSeed(pub [u8; 64]);
300+
/// const N: usize = 64;
301+
/// pub struct MyRngSeed(pub [u8; N]);
301302
/// pub struct MyRng(MyRngSeed);
302303
///
303304
/// impl Default for MyRngSeed {
304305
/// fn default() -> MyRngSeed {
305-
/// MyRngSeed([
306-
/// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
307-
/// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308-
/// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
309-
/// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
310-
/// ])
306+
/// MyRngSeed([0; N])
311307
/// }
312308
/// }
313309
///

0 commit comments

Comments
 (0)