File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 47
47
//! ```
48
48
//! # use rand_core::{RngCore, SeedableRng};
49
49
//! # use rand_mt::Mt64;
50
- //! # fn main () -> Result<(), rand_core::Error> {
50
+ //! # fn example () -> Result<(), rand_core::Error> {
51
51
//! // Create the RNG.
52
52
//! let mut rng = Mt64::new(0x1234_567_89ab_cdef_u64);
53
53
//! // start grabbing randomness from rng...
54
54
//! let mut buf = vec![0; 512];
55
55
//! rng.try_fill_bytes(&mut buf)?;
56
56
//! # Ok(())
57
57
//! # }
58
+ //! # example().unwrap()
58
59
//! ```
59
60
//!
60
61
//! Or if you want to use the default (fixed) seeds that are specified in the
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ impl RngCore for Mt19937GenRand32 {
220
220
/// ```
221
221
/// # use rand_core::RngCore;
222
222
/// # use rand_mt::Mt19937GenRand32;
223
- /// # fn main () -> Result<(), rand_core::Error> {
223
+ /// # fn example () -> Result<(), rand_core::Error> {
224
224
/// let mut mt = Mt19937GenRand32::new_unseeded();
225
225
/// let mut buf = [0; 32];
226
226
/// mt.try_fill_bytes(&mut buf)?;
@@ -230,6 +230,7 @@ impl RngCore for Mt19937GenRand32 {
230
230
/// assert_ne!([0; 31], buf);
231
231
/// # Ok(())
232
232
/// # }
233
+ /// # example().unwrap()
233
234
/// ```
234
235
#[ inline]
235
236
fn try_fill_bytes ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , rand_core:: Error > {
Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ impl RngCore for Mt19937GenRand64 {
216
216
/// ```
217
217
/// # use rand_core::RngCore;
218
218
/// # use rand_mt::Mt19937GenRand64;
219
- /// # fn main () -> Result<(), rand_core::Error> {
219
+ /// # fn example () -> Result<(), rand_core::Error> {
220
220
/// let mut mt = Mt19937GenRand64::new_unseeded();
221
221
/// let mut buf = [0; 32];
222
222
/// mt.try_fill_bytes(&mut buf)?;
@@ -226,6 +226,7 @@ impl RngCore for Mt19937GenRand64 {
226
226
/// assert_ne!([0; 31], buf);
227
227
/// # Ok(())
228
228
/// # }
229
+ /// # example().unwrap()
229
230
/// ```
230
231
#[ inline]
231
232
fn try_fill_bytes ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , rand_core:: Error > {
You can’t perform that action at this time.
0 commit comments