Skip to content

Commit f4e080f

Browse files
authored
Rollup merge of rust-lang#71727 - hbina:simplified_usage, r=Mark-Simulacrum
SipHasher with keys initialized to 0 should just use new() I believe that is what the `new()` is for, for good reasons.
2 parents 09cea4a + 19e5da9 commit f4e080f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/test/ui/deriving/deriving-hash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct Person {
2424
enum E { A=1, B }
2525

2626
fn hash<T: Hash>(t: &T) -> u64 {
27-
let mut s = SipHasher::new_with_keys(0, 0);
27+
let mut s = SipHasher::new();
2828
t.hash(&mut s);
2929
s.finish()
3030
}

src/test/ui/issues/issue-16530.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use std::hash::{SipHasher, Hasher, Hash};
77
struct Empty;
88

99
pub fn main() {
10-
let mut s1 = SipHasher::new_with_keys(0, 0);
10+
let mut s1 = SipHasher::new();
1111
Empty.hash(&mut s1);
12-
let mut s2 = SipHasher::new_with_keys(0, 0);
12+
let mut s2 = SipHasher::new();
1313
Empty.hash(&mut s2);
1414
assert_eq!(s1.finish(), s2.finish());
1515
}

0 commit comments

Comments
 (0)