SipHasher::new() is literally with SipHasher with both keys being 0

This commit is contained in:
Hanif Bin Ariffin 2020-04-30 20:41:51 -04:00
parent 7c8dbd969d
commit 19e5da902b
2 changed files with 3 additions and 3 deletions

View file

@ -24,7 +24,7 @@ struct Person {
enum E { A=1, B }
fn hash<T: Hash>(t: &T) -> u64 {
let mut s = SipHasher::new_with_keys(0, 0);
let mut s = SipHasher::new();
t.hash(&mut s);
s.finish()
}

View file

@ -7,9 +7,9 @@ use std::hash::{SipHasher, Hasher, Hash};
struct Empty;
pub fn main() {
let mut s1 = SipHasher::new_with_keys(0, 0);
let mut s1 = SipHasher::new();
Empty.hash(&mut s1);
let mut s2 = SipHasher::new_with_keys(0, 0);
let mut s2 = SipHasher::new();
Empty.hash(&mut s2);
assert_eq!(s1.finish(), s2.finish());
}