Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified usage code of SipHasher #7945

Merged
merged 1 commit into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn to_hex(num: u64) -> String {
}

pub fn hash_u64<H: Hash>(hashable: H) -> u64 {
let mut hasher = SipHasher::new_with_keys(0, 0);
let mut hasher = SipHasher::new();
hashable.hash(&mut hasher);
hasher.finish()
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl Drop for Cache {
}

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

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

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::<Vec<_>>();
env.sort_unstable();
Expand Down