diff options
| author | Steven Fackler <[email protected]> | 2014-04-18 23:56:01 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-04-18 23:56:01 -0700 |
| commit | cfc79313f59b18a0e6d11002185b503b1590f9d3 (patch) | |
| tree | 089df2dfd4add719df49095e6e92f71303cdbe7d /crypto/rand.rs | |
| parent | Update for IO changes (diff) | |
| download | rust-openssl-cfc79313f59b18a0e6d11002185b503b1590f9d3.tar.xz rust-openssl-cfc79313f59b18a0e6d11002185b503b1590f9d3.zip | |
Update for ~[T] changes
Diffstat (limited to 'crypto/rand.rs')
| -rw-r--r-- | crypto/rand.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/rand.rs b/crypto/rand.rs index 2ae001ef..9db87fcd 100644 --- a/crypto/rand.rs +++ b/crypto/rand.rs @@ -1,14 +1,13 @@ use libc::c_int; -use std::slice; #[link(name = "crypto")] extern { fn RAND_bytes(buf: *mut u8, num: c_int) -> c_int; } -pub fn rand_bytes(len: uint) -> ~[u8] { +pub fn rand_bytes(len: uint) -> Vec<u8> { unsafe { - let mut out = slice::with_capacity(len); + let mut out = Vec::with_capacity(len); let r = RAND_bytes(out.as_mut_ptr(), len as c_int); if r != 1 as c_int { fail!() } |