1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-12-04 09:21:55 +01:00

test bytestring with ahash

This commit is contained in:
Rob Ede 2021-01-03 04:42:08 +00:00
parent 5285656bdc
commit 147c4f4f2c
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
2 changed files with 4 additions and 4 deletions

View File

@ -24,4 +24,4 @@ serde = { version = "1.0", optional = true }
[dev-dependencies] [dev-dependencies]
serde_json = "1.0" serde_json = "1.0"
siphasher = "0.3" ahash = { version = "0.6", default-features = false }

View File

@ -224,7 +224,7 @@ mod test {
use alloc::borrow::ToOwned; use alloc::borrow::ToOwned;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use siphasher::sip::SipHasher; use ahash::AHasher;
use super::*; use super::*;
@ -243,10 +243,10 @@ mod test {
#[test] #[test]
fn test_hash() { fn test_hash() {
let mut hasher1 = SipHasher::default(); let mut hasher1 = AHasher::default();
"str".hash(&mut hasher1); "str".hash(&mut hasher1);
let mut hasher2 = SipHasher::default(); let mut hasher2 = AHasher::default();
let s = ByteString::from_static("str"); let s = ByteString::from_static("str");
s.hash(&mut hasher2); s.hash(&mut hasher2);
assert_eq!(hasher1.finish(), hasher2.finish()); assert_eq!(hasher1.finish(), hasher2.finish());