diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-05-06 13:22:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-06 13:22:13 +0200 |
| commit | 3f56b84182dfa9aea0cd60d6be26e840ca5e210e (patch) | |
| tree | 04df8cd2737575086ebeb428e463f662828ae2af | |
| parent | 78a25cb10e28207398b16fecbcd92accb6a65e9e (diff) | |
| parent | 19e5da902bf6ade2c0558383051215459754b73d (diff) | |
| download | rust-3f56b84182dfa9aea0cd60d6be26e840ca5e210e.tar.gz rust-3f56b84182dfa9aea0cd60d6be26e840ca5e210e.zip | |
Rollup merge of #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.
| -rw-r--r-- | src/test/ui/deriving/deriving-hash.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-16530.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/test/ui/deriving/deriving-hash.rs b/src/test/ui/deriving/deriving-hash.rs index 68c68c235ef..8b51370bca5 100644 --- a/src/test/ui/deriving/deriving-hash.rs +++ b/src/test/ui/deriving/deriving-hash.rs @@ -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() } diff --git a/src/test/ui/issues/issue-16530.rs b/src/test/ui/issues/issue-16530.rs index 22a6ef7fa09..25817a2a63d 100644 --- a/src/test/ui/issues/issue-16530.rs +++ b/src/test/ui/issues/issue-16530.rs @@ -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()); } |
