summaryrefslogtreecommitdiffstats
path: root/third_party/rust/hashlink/tests/serde.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /third_party/rust/hashlink/tests/serde.rs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/hashlink/tests/serde.rs')
-rw-r--r--third_party/rust/hashlink/tests/serde.rs10
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');