From b9dbfcb4ac3b7a663d9efc6eb1387c62302a6fb4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 16 Nov 2024 12:24:01 -0800 Subject: [PATCH] Switch out fnv in favor of foldhash in test --- test_suite/Cargo.toml | 2 +- test_suite/tests/test_de.rs | 5 ++--- test_suite/tests/test_ser.rs | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test_suite/Cargo.toml b/test_suite/Cargo.toml index 07e62656a..4076e735a 100644 --- a/test_suite/Cargo.toml +++ b/test_suite/Cargo.toml @@ -13,7 +13,7 @@ serde = { path = "../serde" } [dev-dependencies] automod = "1.0.1" -fnv = "1.0" +foldhash = "0.1" rustversion = "1.0" serde = { path = "../serde", features = ["rc"] } serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] } diff --git a/test_suite/tests/test_de.rs b/test_suite/tests/test_de.rs index 9726ef543..2e80fbaf9 100644 --- a/test_suite/tests/test_de.rs +++ b/test_suite/tests/test_de.rs @@ -10,7 +10,6 @@ )] #![cfg_attr(feature = "unstable", feature(never_type))] -use fnv::FnvBuildHasher; use serde::de::value::{F32Deserializer, F64Deserializer}; use serde::de::{Deserialize, DeserializeOwned, Deserializer, IntoDeserializer}; use serde_derive::Deserialize; @@ -1040,7 +1039,7 @@ fn test_hashset() { ], ); test( - hashset![FnvBuildHasher; 1, 2, 3], + hashset![foldhash::fast::FixedState; 1, 2, 3], &[ Token::Seq { len: Some(3) }, Token::I32(1), @@ -1275,7 +1274,7 @@ fn test_hashmap() { ], ); test( - hashmap![FnvBuildHasher; 1 => 2, 3 => 4], + hashmap![foldhash::fast::FixedState; 1 => 2, 3 => 4], &[ Token::Map { len: Some(2) }, Token::I32(1), diff --git a/test_suite/tests/test_ser.rs b/test_suite/tests/test_ser.rs index 0a1c1ee97..1c8063184 100644 --- a/test_suite/tests/test_ser.rs +++ b/test_suite/tests/test_ser.rs @@ -1,7 +1,6 @@ #![allow(clippy::derive_partial_eq_without_eq, clippy::unreadable_literal)] #![cfg_attr(feature = "unstable", feature(never_type))] -use fnv::FnvBuildHasher; use serde_derive::Serialize; use serde_test::{assert_ser_tokens, assert_ser_tokens_error, Configure, Token}; use std::cell::RefCell; @@ -220,7 +219,7 @@ fn test_hashset() { &[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd], ); assert_ser_tokens( - &hashset![FnvBuildHasher; 1], + &hashset![foldhash::fast::FixedState; 1], &[Token::Seq { len: Some(1) }, Token::I32(1), Token::SeqEnd], ); } @@ -300,7 +299,7 @@ fn test_hashmap() { ], ); assert_ser_tokens( - &hashmap![FnvBuildHasher; 1 => 2], + &hashmap![foldhash::fast::FixedState; 1 => 2], &[ Token::Map { len: Some(1) }, Token::I32(1),