Skip to content

Commit b328ee7

Browse files
committed
Eliminate hash closure in favor of calling hash_one directly
1 parent b9bcbad commit b328ee7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,15 +2492,14 @@ fn test_value_into_deserializer() {
24922492
#[test]
24932493
fn hash_positive_and_negative_zero() {
24942494
let rand = std::hash::RandomState::new();
2495-
let hash = |obj| rand.hash_one(obj);
24962495

24972496
let k1 = serde_json::from_str::<Number>("0.0").unwrap();
24982497
let k2 = serde_json::from_str::<Number>("-0.0").unwrap();
24992498
if cfg!(feature = "arbitrary_precision") {
25002499
assert_ne!(k1, k2);
2501-
assert_ne!(hash(k1), hash(k2));
2500+
assert_ne!(rand.hash_one(k1), rand.hash_one(k2));
25022501
} else {
25032502
assert_eq!(k1, k2);
2504-
assert_eq!(hash(k1), hash(k2));
2503+
assert_eq!(rand.hash_one(k1), rand.hash_one(k2));
25052504
}
25062505
}

0 commit comments

Comments
 (0)