diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-10-02 03:17:57 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-10-09 22:22:43 +1100 |
| commit | 98869799eb2604ecd7c947db117794df10890a2c (patch) | |
| tree | 6350646781d2248e76e773f2f6b04247799d8674 /src/libstd/rand/reader.rs | |
| parent | 0b1a0d01a8d0a769cc2c0bd9b11bfb71864d2f36 (diff) | |
| download | rust-98869799eb2604ecd7c947db117794df10890a2c.tar.gz rust-98869799eb2604ecd7c947db117794df10890a2c.zip | |
std::rand: documentation additions & fixes.
Diffstat (limited to 'src/libstd/rand/reader.rs')
| -rw-r--r-- | src/libstd/rand/reader.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 32a97100fa1..78dad30117d 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +//! A wrapper around any Reader to treat it as an RNG. + use option::{Some, None}; use rt::io::Reader; use rt::io::ReaderByteConversions; @@ -22,12 +24,12 @@ use rand::Rng; /// # Example /// /// ```rust -/// use std::rand::reader; +/// use std::rand::{reader, Rng}; /// use std::rt::io::mem; /// /// fn main() { /// let mut rng = reader::ReaderRng::new(mem::MemReader::new(~[1,2,3,4,5,6,7,8])); -/// println!("{}", rng.gen::<uint>()); +/// println!("{:x}", rng.gen::<uint>()); /// } /// ``` pub struct ReaderRng<R> { |
