SipHasher::new() is literally with SipHasher with both keys being 0
This commit is contained in:
parent
7c8dbd969d
commit
19e5da902b
2 changed files with 3 additions and 3 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue