From b328ee7df4dd772922f084600aa7cea39218b694 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 28 Dec 2023 15:39:40 -0800 Subject: [PATCH] Eliminate hash closure in favor of calling hash_one directly --- tests/test.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index 47b6f1c2f..05b7f86fc 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -2492,15 +2492,14 @@ fn test_value_into_deserializer() { #[test] fn hash_positive_and_negative_zero() { let rand = std::hash::RandomState::new(); - let hash = |obj| rand.hash_one(obj); let k1 = serde_json::from_str::("0.0").unwrap(); let k2 = serde_json::from_str::("-0.0").unwrap(); if cfg!(feature = "arbitrary_precision") { assert_ne!(k1, k2); - assert_ne!(hash(k1), hash(k2)); + assert_ne!(rand.hash_one(k1), rand.hash_one(k2)); } else { assert_eq!(k1, k2); - assert_eq!(hash(k1), hash(k2)); + assert_eq!(rand.hash_one(k1), rand.hash_one(k2)); } }