1
Fork 0

Documentation & address minor point.

This commit is contained in:
Huon Wilson 2013-10-09 01:54:21 +11:00
parent 71addded64
commit a836f13dc0

View file

@ -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)
}
}