Bump hex to 0.3
authorBastien Orivel <eijebong@bananium.fr>
Tue, 2 Jan 2018 19:35:32 +0000 (20:35 +0100)
committerBastien Orivel <eijebong@bananium.fr>
Tue, 2 Jan 2018 19:35:32 +0000 (20:35 +0100)
Cargo.toml
src/cargo/sources/directory.rs
src/cargo/sources/registry/local.rs
src/cargo/sources/registry/remote.rs
src/cargo/util/hex.rs

index 912b5446932b37a726f8baf84c8a164bd861e0c3..9152b754d7cf4bbf72556d4a19e92ef09b6218bb 100644 (file)
@@ -31,7 +31,7 @@ fs2 = "0.4"
 git2 = "0.6"
 git2-curl = "0.7"
 glob = "0.2"
-hex = "0.2"
+hex = "0.3"
 home = "0.3"
 ignore = "0.3"
 jobserver = "0.1.6"
index d2db5b08e3de283932b48ad74f2e726ecdebd1b3..8416485b572fa5be75a29f2a610c87fe2826db54 100644 (file)
@@ -4,7 +4,7 @@ use std::fs::File;
 use std::io::Read;
 use std::path::{Path, PathBuf};
 
-use hex::ToHex;
+use hex;
 
 use serde_json;
 
@@ -184,7 +184,7 @@ impl<'cfg> Source for DirectorySource<'cfg> {
                         file.display())
             })?;
 
-            let actual = h.finish().to_hex();
+            let actual = hex::encode(h.finish());
             if &*actual != cksum {
                 bail!("\
                     the listed checksum of `{}` has changed:\n\
index 5803fd77d94a9607fd042652b73283e3c8f91332..d4d67a229b38ac539fbb7545f9e15e5f68899370 100644 (file)
@@ -3,7 +3,7 @@ use std::io::prelude::*;
 use std::path::Path;
 
 use core::PackageId;
-use hex::ToHex;
+use hex;
 use sources::registry::{RegistryData, RegistryConfig};
 use util::FileLock;
 use util::paths;
@@ -94,7 +94,7 @@ impl<'cfg> RegistryData for LocalRegistry<'cfg> {
             }
             state.update(&buf[..n]);
         }
-        if state.finish().to_hex() != checksum {
+        if hex::encode(state.finish()) != checksum {
             bail!("failed to verify the checksum of `{}`", pkg)
         }
 
index 489d001b95274d0e0523f4d0bb4e72f173896e11..a2a0f9402739ae9150878afc8cb84ce33a8ddac8 100644 (file)
@@ -7,7 +7,7 @@ use std::path::Path;
 use std::str;
 
 use git2;
-use hex::ToHex;
+use hex;
 use serde_json;
 
 use core::{PackageId, SourceId};
@@ -250,7 +250,7 @@ impl<'cfg> RegistryData for RemoteRegistry<'cfg> {
         })?;
 
         // Verify what we just downloaded
-        if state.finish().to_hex() != checksum {
+        if hex::encode(state.finish()) != checksum {
             bail!("failed to verify the checksum of `{}`", pkg)
         }
 
index 71a4c112fd30a440ae12c3ab7734c5dc4b4fbcc4..16bd16fcd31253ae6060e00d6d3e4b95dd9a4bd3 100644 (file)
@@ -1,10 +1,10 @@
 #![allow(deprecated)]
 
-use hex::ToHex;
+use hex;
 use std::hash::{Hasher, Hash, SipHasher};
 
 pub fn to_hex(num: u64) -> String {
-    [
+    hex::encode(&[
         (num >>  0) as u8,
         (num >>  8) as u8,
         (num >> 16) as u8,
@@ -13,7 +13,7 @@ pub fn to_hex(num: u64) -> String {
         (num >> 40) as u8,
         (num >> 48) as u8,
         (num >> 56) as u8,
-    ].to_hex()
+    ])
 }
 
 pub fn hash_u64<H: Hash>(hashable: &H) -> u64 {