Bump ipc-channel and bincode

This required bumping uuid too which unfortunately duplicated rand.
This commit is contained in:
Bastien Orivel 2018-03-21 13:04:41 +01:00
parent 5b575e3647
commit 570d865065
34 changed files with 152 additions and 107 deletions

View file

@ -17,6 +17,7 @@ extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate rand;
extern crate uuid;
pub use rand::{Rand, Rng, SeedableRng};
#[cfg(target_pointer_width = "64")]
@ -30,6 +31,7 @@ use std::mem;
use std::rc::Rc;
use std::sync::Mutex;
use std::u64;
use uuid::Uuid;
// Slightly annoying having to cast between sizes.
@ -156,3 +158,11 @@ impl Rng for ServoThreadRng {
pub fn random<T: Rand>() -> T {
thread_rng().gen()
}
// TODO(eijebong): Replace calls to this by random once `uuid::Uuid` implements `rand::Rand` again.
#[inline]
pub fn random_uuid() -> Uuid {
let mut bytes = [0; 16];
thread_rng().fill_bytes(&mut bytes);
Uuid::from_random_bytes(bytes)
}