rollup merge of #19101: vhbit/ios-rng-fix

This commit is contained in:
Jakub Bukaj 2014-11-19 22:40:05 +01:00
commit 00ffcca016

View File

@ -212,12 +212,12 @@ pub fn new() -> IoResult<OsRng> {
impl Rng for OsRng {
fn next_u32(&mut self) -> u32 {
let mut v = [0u8, .. 4];
self.fill_bytes(v);
self.fill_bytes(&mut v);
unsafe { mem::transmute(v) }
}
fn next_u64(&mut self) -> u64 {
let mut v = [0u8, .. 8];
self.fill_bytes(v);
self.fill_bytes(&mut v);
unsafe { mem::transmute(v) }
}
fn fill_bytes(&mut self, v: &mut [u8]) {