Skip to content

Commit

Permalink
SipHasher::new() is literally with SipHasher with both keys being 0
Browse files Browse the repository at this point in the history
  • Loading branch information
hbina committed May 2, 2020
1 parent 7c8dbd9 commit 19e5da9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/deriving/deriving-hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-16530.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

0 comments on commit 19e5da9

Please sign in to comment.