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/x509 | |
| 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/x509')
| -rw-r--r-- | src/x509/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/x509/mod.rs b/src/x509/mod.rs index ed8fb77d..4537e553 100644 --- a/src/x509/mod.rs +++ b/src/x509/mod.rs @@ -1,6 +1,7 @@ use libc::{c_int, c_long, c_uint}; use std::c_str::ToCStr; use std::cmp::Ordering; +use std::iter::repeat; use std::mem; use std::num::SignedInt; use std::ptr; @@ -385,7 +386,7 @@ impl<'ctx> X509<'ctx> { /// Returns certificate fingerprint calculated using provided hash pub fn fingerprint(&self, hash_type: HashType) -> Option<Vec<u8>> { let (evp, len) = evpmd(hash_type); - let v: Vec<u8> = Vec::from_elem(len, 0); + let v: Vec<u8> = repeat(0).take(len).collect(); let act_len: c_uint = 0; let res = unsafe { ffi::X509_digest(self.handle, evp, mem::transmute(v.as_ptr()), |