Skip to content

Commit 142c057

Browse files
committed
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.
1 parent e618d47 commit 142c057

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/cargo/core/compiler/context/compilation_files.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ fn compute_metadata<'a, 'cfg>(
562562
return None;
563563
}
564564

565-
let mut hasher = SipHasher::new_with_keys(0, 0);
565+
let mut hasher = SipHasher::new();
566566

567567
// This is a generic version number that can be changed to make
568568
// backwards-incompatible changes to any file structures in the output

src/cargo/util/hex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn to_hex(num: u64) -> String {
1616
}
1717

1818
pub fn hash_u64<H: Hash>(hashable: H) -> u64 {
19-
let mut hasher = SipHasher::new_with_keys(0, 0);
19+
let mut hasher = SipHasher::new();
2020
hashable.hash(&mut hasher);
2121
hasher.finish()
2222
}

src/cargo/util/rustc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl Drop for Cache {
216216
}
217217

218218
fn rustc_fingerprint(path: &Path, rustup_rustc: &Path) -> CargoResult<u64> {
219-
let mut hasher = SipHasher::new_with_keys(0, 0);
219+
let mut hasher = SipHasher::new();
220220

221221
let path = paths::resolve_executable(path)?;
222222
path.hash(&mut hasher);
@@ -260,7 +260,7 @@ fn rustc_fingerprint(path: &Path, rustup_rustc: &Path) -> CargoResult<u64> {
260260
}
261261

262262
fn process_fingerprint(cmd: &ProcessBuilder) -> u64 {
263-
let mut hasher = SipHasher::new_with_keys(0, 0);
263+
let mut hasher = SipHasher::new();
264264
cmd.get_args().hash(&mut hasher);
265265
let mut env = cmd.get_envs().iter().collect::<Vec<_>>();
266266
env.sort_unstable();

0 commit comments

Comments
 (0)