summary refs log tree commit diff
path: root/src/libstd/rand/mod.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-10-09 17:39:37 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-10-09 22:22:44 +1100
commite678435cab9cc8ddd668d4cb58ab82194c220382 (patch)
tree2255fb00fe6bb785dc20066c97333d5771e25e00 /src/libstd/rand/mod.rs
parent5442a473624f9d463a21508a5dbdd5a5ec326c15 (diff)
downloadrust-e678435cab9cc8ddd668d4cb58ab82194c220382.tar.gz
rust-e678435cab9cc8ddd668d4cb58ab82194c220382.zip
std::rand: Minor clean-up of comments & add a missing default method.
Diffstat (limited to 'src/libstd/rand/mod.rs')
-rw-r--r--src/libstd/rand/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs
index aa4b496338d..9b757092266 100644
--- a/src/libstd/rand/mod.rs
+++ b/src/libstd/rand/mod.rs
@@ -648,8 +648,6 @@ impl SeedableRng<[u32, .. 4]> for XorShiftRng {
 impl XorShiftRng {
     /// Create an xor shift random number generator with a random seed.
     pub fn new() -> XorShiftRng {
-        // generate seeds the same way as seed(), except we have a
-        // specific size, so we can just use a fixed buffer.
         let mut s = [0u8, ..16];
         loop {
             let mut r = OSRng::new();
@@ -714,6 +712,11 @@ impl<R: Rng> Rng for @mut R {
     fn next_u64(&mut self) -> u64 {
         (**self).next_u64()
     }
+
+    #[inline]
+    fn fill_bytes(&mut self, bytes: &mut [u8]) {
+        (**self).fill_bytes(bytes);
+    }
 }
 
 /// Generate a random value using the task-local random number