From 142c0575a92a1786a0f330d738ad52fe9fd1e1ed Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Thu, 27 Feb 2020 14:16:05 -0500 Subject: [PATCH] Simplified usage code of SipHasher SipHasher::new_with_keys(0,0) is just a longer version of just _::new() i.e. the latter is an alias for the former. --- src/cargo/core/compiler/context/compilation_files.rs | 2 +- src/cargo/util/hex.rs | 2 +- src/cargo/util/rustc.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/compiler/context/compilation_files.rs b/src/cargo/core/compiler/context/compilation_files.rs index f9eab92f67d..a9d6eb2861d 100644 --- a/src/cargo/core/compiler/context/compilation_files.rs +++ b/src/cargo/core/compiler/context/compilation_files.rs @@ -562,7 +562,7 @@ fn compute_metadata<'a, 'cfg>( return None; } - let mut hasher = SipHasher::new_with_keys(0, 0); + let mut hasher = SipHasher::new(); // This is a generic version number that can be changed to make // backwards-incompatible changes to any file structures in the output diff --git a/src/cargo/util/hex.rs b/src/cargo/util/hex.rs index f3e905c9aba..4be23ba020c 100644 --- a/src/cargo/util/hex.rs +++ b/src/cargo/util/hex.rs @@ -16,7 +16,7 @@ pub fn to_hex(num: u64) -> String { } pub fn hash_u64(hashable: H) -> u64 { - let mut hasher = SipHasher::new_with_keys(0, 0); + let mut hasher = SipHasher::new(); hashable.hash(&mut hasher); hasher.finish() } diff --git a/src/cargo/util/rustc.rs b/src/cargo/util/rustc.rs index bb54119b91e..0a3e6e46276 100644 --- a/src/cargo/util/rustc.rs +++ b/src/cargo/util/rustc.rs @@ -216,7 +216,7 @@ impl Drop for Cache { } fn rustc_fingerprint(path: &Path, rustup_rustc: &Path) -> CargoResult { - let mut hasher = SipHasher::new_with_keys(0, 0); + let mut hasher = SipHasher::new(); let path = paths::resolve_executable(path)?; path.hash(&mut hasher); @@ -260,7 +260,7 @@ fn rustc_fingerprint(path: &Path, rustup_rustc: &Path) -> CargoResult { } fn process_fingerprint(cmd: &ProcessBuilder) -> u64 { - let mut hasher = SipHasher::new_with_keys(0, 0); + let mut hasher = SipHasher::new(); cmd.get_args().hash(&mut hasher); let mut env = cmd.get_envs().iter().collect::>(); env.sort_unstable();