Skip to content

Commit

Permalink
Merge pull request #131 from artichoke/lopopolo/test-fnv
Browse files Browse the repository at this point in the history
Replace rustc-hash with fnv
  • Loading branch information
lopopolo authored Jul 11, 2024
2 parents a126d51 + 45255ac commit 1eb11a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include = ["src/**/*", "tests/**/*", "LICENSE", "README.md"]

[dev-dependencies]
# a no_std hasher for tests of `impl Hash for RawParts`
rustc-hash = { version = "1.1.0", default-features = false }
fnv = { version = "1.0.6", default-features = false }

# Check that crate versions are properly updated in documentation and code when
# bumping the version.
Expand Down
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ mod tests {
use alloc::vec::Vec;
use core::hash::{Hash, Hasher};

use rustc_hash::FxHasher;
use fnv::FnvHasher;

use crate::RawParts;

Expand Down Expand Up @@ -462,12 +462,12 @@ mod tests {
vec_2.extend_from_slice(b"123456789"); // length is 9

let raw_parts_1 = RawParts::from_vec(vec_1);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_1.hash(&mut hasher);
let hash_a = hasher.finish();

let raw_parts_2 = RawParts::from_vec(vec_2);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_2.hash(&mut hasher);
let hash_b = hasher.finish();

Expand All @@ -482,12 +482,12 @@ mod tests {
vec_2.extend_from_slice(b"123456789"); // length is 9

let raw_parts_1 = RawParts::from_vec(vec_1);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_1.hash(&mut hasher);
let hash_a = hasher.finish();

let raw_parts_2 = RawParts::from_vec(vec_2);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_2.hash(&mut hasher);
let hash_b = hasher.finish();

Expand All @@ -502,12 +502,12 @@ mod tests {
vec_2.extend_from_slice(b"12345678"); // length is 8

let raw_parts_1 = RawParts::from_vec(vec_1);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_1.hash(&mut hasher);
let hash_a = hasher.finish();

let raw_parts_2 = RawParts::from_vec(vec_2);
let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts_2.hash(&mut hasher);
let hash_b = hasher.finish();

Expand All @@ -520,11 +520,11 @@ mod tests {
vec.extend_from_slice(b"123456789"); // length is 9
let raw_parts = RawParts::from_vec(vec);

let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts.hash(&mut hasher);
let hash_a = hasher.finish();

let mut hasher = FxHasher::default();
let mut hasher = FnvHasher::default();
raw_parts.hash(&mut hasher);
let hash_b = hasher.finish();

Expand Down

0 comments on commit 1eb11a9

Please sign in to comment.