about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-10-09 01:54:21 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-10-09 22:22:43 +1100
commita836f13dc0c2c636fd00b77d05f50a00cc3a7c55 (patch)
tree08c5e1773750cd0adb91f625cfdfaaced66a288c
parent71addded64548ff845d9ef3852a2c1d2592ae39f (diff)
downloadrust-a836f13dc0c2c636fd00b77d05f50a00cc3a7c55.tar.gz
rust-a836f13dc0c2c636fd00b77d05f50a00cc3a7c55.zip
Documentation & address minor point.
-rw-r--r--src/libstd/rand/mod.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs
index b07d00f2236..1465e594227 100644
--- a/src/libstd/rand/mod.rs
+++ b/src/libstd/rand/mod.rs
@@ -535,8 +535,9 @@ pub trait SeedableRng<Seed>: Rng {
 ///
 /// This is a very expensive operation as it has to read randomness
 /// from the operating system and use this in an expensive seeding
-/// operation. If one does not require high performance, `task_rng`
-/// and/or `random` may be more appropriate.
+/// operation. If one does not require high performance generation of
+/// random numbers, `task_rng` and/or `random` may be more
+/// appropriate.
 pub fn rng() -> StdRng {
     StdRng::new()
 }
@@ -596,6 +597,9 @@ impl<'self> SeedableRng<&'self [uint]> for StdRng {
 /// consideration for cryptography or security. If you require a specifically
 /// seeded `Rng` for consistency over time you should pick one algorithm and
 /// create the `Rng` yourself.
+///
+/// This will read randomness from the operating system to seed the
+/// generator.
 pub fn weak_rng() -> XorShiftRng {
     XorShiftRng::new()
 }
@@ -667,8 +671,8 @@ impl XorShiftRng {
                 break;
             }
         }
-        let s: &[u32, ..4] = unsafe { cast::transmute(&s) };
-        SeedableRng::from_seed(*s)
+        let s: [u32, ..4] = unsafe { cast::transmute(s) };
+        SeedableRng::from_seed(s)
     }
 }