diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-05-27 09:49:54 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-05-27 14:47:21 -0400 |
| commit | 0d5fdce82e1e09df96ea2ee190e9fffd91b2c714 (patch) | |
| tree | 3a003da2cb972550f937356f803fa6461ff8f56c /src/libstd/rand.rs | |
| parent | 3941f78a1bfb3ecf077dd782e5d03ea7fafcad86 (diff) | |
| download | rust-0d5fdce82e1e09df96ea2ee190e9fffd91b2c714.tar.gz rust-0d5fdce82e1e09df96ea2ee190e9fffd91b2c714.zip | |
syntax highlight code examples in docstrings
Diffstat (limited to 'src/libstd/rand.rs')
| -rw-r--r-- | src/libstd/rand.rs | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/libstd/rand.rs b/src/libstd/rand.rs index 09d0a38e16d..2bcc9c8bba2 100644 --- a/src/libstd/rand.rs +++ b/src/libstd/rand.rs @@ -20,7 +20,8 @@ See the `distributions` submodule for sampling random numbers from distributions like normal and exponential. # Examples -~~~ + +~~~ {.rust} use core::rand::RngUtil; fn main() { @@ -31,7 +32,7 @@ fn main() { } ~~~ -~~~ +~~~ {.rust} fn main () { let tuple_ptr = rand::random::<~(f64, char)>(); println(fmt!("%?", tuple_ptr)) @@ -276,9 +277,9 @@ pub trait RngUtil { /** * Return a bool with a 1 in n chance of true * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -292,9 +293,9 @@ pub trait RngUtil { /** * Return a random string of the specified length composed of A-Z,a-z,0-9 * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -308,9 +309,9 @@ pub trait RngUtil { /** * Return a random byte string of the specified length * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -324,9 +325,9 @@ pub trait RngUtil { /** * Choose an item randomly, failing if values is empty * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -343,9 +344,9 @@ pub trait RngUtil { * Choose an item respecting the relative weights, failing if the sum of * the weights is 0 * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -363,9 +364,9 @@ pub trait RngUtil { * Choose Some(item) respecting the relative weights, returning none if * the sum of the weights is 0 * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -384,9 +385,9 @@ pub trait RngUtil { * Return a vec containing copies of the items, in order, where * the weight of the item determines how many copies there are * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -403,9 +404,9 @@ pub trait RngUtil { /** * Shuffle a vec * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * @@ -419,9 +420,9 @@ pub trait RngUtil { /** * Shuffle a mutable vec in place * - * *Example* + * # Example * - * ~~~ + * ~~~ {.rust} * * use core::rand::RngUtil; * |
