diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-27 23:00:46 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-04-02 23:29:28 +1100 |
| commit | c5d85560a98940e7938d0b074d7d0a9ec6a417c5 (patch) | |
| tree | cb666339236d555a67c9bb6538f577f0f4e5d0cd /src/libuuid/lib.rs | |
| parent | c98713486579f7f18bed64c2a160f8ef89b5733f (diff) | |
rand: remove (almost) all ~[]'s from Vec.
There are a few instances of them in tests which are using functions from std etc. that still are using ~[].
Diffstat (limited to 'src/libuuid/lib.rs')
| -rw-r--r-- | src/libuuid/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libuuid/lib.rs b/src/libuuid/lib.rs index d1e4a1c0472..f70cb908b52 100644 --- a/src/libuuid/lib.rs +++ b/src/libuuid/lib.rs @@ -196,7 +196,7 @@ impl Uuid { pub fn new_v4() -> Uuid { let ub = rand::task_rng().gen_vec(16); let mut uuid = Uuid{ bytes: [0, .. 16] }; - slice::bytes::copy_memory(uuid.bytes, ub); + slice::bytes::copy_memory(uuid.bytes, ub.as_slice()); uuid.set_variant(VariantRFC4122); uuid.set_version(Version4Random); uuid @@ -510,7 +510,7 @@ impl rand::Rand for Uuid { fn rand<R: rand::Rng>(rng: &mut R) -> Uuid { let ub = rng.gen_vec(16); let mut uuid = Uuid{ bytes: [0, .. 16] }; - slice::bytes::copy_memory(uuid.bytes, ub); + slice::bytes::copy_memory(uuid.bytes, ub.as_slice()); uuid.set_variant(VariantRFC4122); uuid.set_version(Version4Random); uuid |
