From ed77f12df694d936728d4f1806df1df930570811 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Tue, 10 Apr 2018 11:32:23 +0200 Subject: [PATCH] Simplify example for large seeds --- rand_core/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/rand_core/src/lib.rs b/rand_core/src/lib.rs index 9a6b39d3228..291edd4daaa 100644 --- a/rand_core/src/lib.rs +++ b/rand_core/src/lib.rs @@ -297,17 +297,13 @@ pub trait SeedableRng: Sized { /// ``` /// use rand_core::SeedableRng; /// - /// pub struct MyRngSeed(pub [u8; 64]); + /// const N: usize = 64; + /// pub struct MyRngSeed(pub [u8; N]); /// pub struct MyRng(MyRngSeed); /// /// impl Default for MyRngSeed { /// fn default() -> MyRngSeed { - /// MyRngSeed([ - /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /// ]) + /// MyRngSeed([0; N]) /// } /// } ///