mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Bump ipc-channel and bincode
This required bumping uuid too which unfortunately duplicated rand.
This commit is contained in:
parent
5b575e3647
commit
570d865065
34 changed files with 152 additions and 107 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue