diff options
| author | Steven Fackler <[email protected]> | 2015-01-03 08:31:57 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-01-03 08:31:57 -0800 |
| commit | 2f24d8e771cfc140e53e6afe58994aafd455b701 (patch) | |
| tree | 2d44ec4c5167f99abc05e8d0df9f3528ad872f72 /src/crypto/hash.rs | |
| parent | Merge pull request #136 from vhbit/up-master (diff) | |
| download | rust-openssl-2f24d8e771cfc140e53e6afe58994aafd455b701.tar.xz rust-openssl-2f24d8e771cfc140e53e6afe58994aafd455b701.zip | |
Fix deprecation warnings
Diffstat (limited to 'src/crypto/hash.rs')
| -rw-r--r-- | src/crypto/hash.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crypto/hash.rs b/src/crypto/hash.rs index a9711e92..1f8a3936 100644 --- a/src/crypto/hash.rs +++ b/src/crypto/hash.rs @@ -1,6 +1,7 @@ use libc::c_uint; use std::ptr; use std::io; +use std::iter::repeat; use ffi; @@ -101,7 +102,7 @@ impl Hasher { * initialization and its context for reuse */ pub fn finalize_reuse(self) -> (Vec<u8>, HasherContext) { - let mut res = Vec::from_elem(self.len, 0u8); + let mut res = repeat(0u8).take(self.len).collect::<Vec<_>>(); unsafe { ffi::EVP_DigestFinal_ex(self.ctx.ptr, res.as_mut_ptr(), ptr::null_mut()) }; |