diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-10-08 15:48:28 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2016-10-08 15:48:28 +0200 |
| commit | 717d2ddca7a11088716193453378b65c04995021 (patch) | |
| tree | eb0f44c8a04de2587e9b3e6873d95867aaea0c9b /src/libstd/sys/unix/rand.rs | |
| parent | e51190cf07eb4e817d35c7d45eb89ec5a1ae8ddc (diff) | |
| download | rust-717d2ddca7a11088716193453378b65c04995021.tar.gz rust-717d2ddca7a11088716193453378b65c04995021.zip | |
Use less `size_t` casts in libstd since it's now defined as `usize`
Diffstat (limited to 'src/libstd/sys/unix/rand.rs')
| -rw-r--r-- | src/libstd/sys/unix/rand.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/rand.rs b/src/libstd/sys/unix/rand.rs index 6b50ca9bcdf..f28a6ad3375 100644 --- a/src/libstd/sys/unix/rand.rs +++ b/src/libstd/sys/unix/rand.rs @@ -97,8 +97,8 @@ mod imp { // full entropy pool let reader = File::open("/dev/urandom").expect("Unable to open /dev/urandom"); let mut reader_rng = ReaderRng::new(reader); - reader_rng.fill_bytes(& mut v[read..]); - read += v.len() as usize; + reader_rng.fill_bytes(&mut v[read..]); + read += v.len(); } else { panic!("unexpected getrandom error: {}", err); } @@ -281,7 +281,7 @@ mod imp { } fn fill_bytes(&mut self, v: &mut [u8]) { let ret = unsafe { - SecRandomCopyBytes(kSecRandomDefault, v.len() as size_t, + SecRandomCopyBytes(kSecRandomDefault, v.len(), v.as_mut_ptr()) }; if ret == -1 { |
