diff options
Diffstat (limited to 'third_party/rust/hashlink/tests/serde.rs')
-rw-r--r-- | third_party/rust/hashlink/tests/serde.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/third_party/rust/hashlink/tests/serde.rs b/third_party/rust/hashlink/tests/serde.rs index d397a245fa..2cf4a3e3fb 100644 --- a/third_party/rust/hashlink/tests/serde.rs +++ b/third_party/rust/hashlink/tests/serde.rs @@ -1,7 +1,9 @@ #![cfg(feature = "serde_impl")] -use fxhash::FxBuildHasher; +use std::hash::BuildHasherDefault; + use hashlink::{LinkedHashMap, LinkedHashSet}; +use rustc_hash::FxHasher; use serde_test::{assert_tokens, Token}; #[test] @@ -35,14 +37,14 @@ fn map_serde_tokens() { #[test] fn map_serde_tokens_empty_generic() { - let map = LinkedHashMap::<char, u32, FxBuildHasher>::with_hasher(FxBuildHasher::default()); + let map = LinkedHashMap::<char, u32, BuildHasherDefault<FxHasher>>::default(); assert_tokens(&map, &[Token::Map { len: Some(0) }, Token::MapEnd]); } #[test] fn map_serde_tokens_generic() { - let mut map = LinkedHashMap::with_hasher(FxBuildHasher::default()); + let mut map = LinkedHashMap::<char, i32, BuildHasherDefault<FxHasher>>::default(); map.insert('a', 10); map.insert('b', 20); map.insert('c', 30); @@ -90,7 +92,7 @@ fn set_serde_tokens() { #[test] fn set_serde_tokens_generic() { - let mut set = LinkedHashSet::with_hasher(FxBuildHasher::default()); + let mut set = LinkedHashSet::<char, BuildHasherDefault<FxHasher>>::default(); set.insert('a'); set.insert('b'); set.insert('c'); |