From 04c75109057e59f6cf99a4ffc16867eb5a6cbd4b Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 18 Oct 2024 12:36:28 -0700 Subject: [PATCH] Update twoxhash to 2.0 --- Cargo.lock | 14 ++------------ Cargo.toml | 2 +- provider/blob/tests/test_versions.rs | 5 +---- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bb57dd018f..62d426e1827 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2768,12 +2768,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strck" version = "1.0.0" @@ -2965,13 +2959,9 @@ dependencies = [ [[package]] name = "twox-hash" -version = "1.6.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] +checksum = "e7b17f197b3050ba473acf9181f7b1d3b66d1cf7356c6cc57886662276e65908" [[package]] name = "typenum" diff --git a/Cargo.toml b/Cargo.toml index 0b9e0d3847e..58040ff0ba4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -258,7 +258,7 @@ serde = { version = "1.0.110", default-features = false } serde-json-core = { version = "0.4.0", default-features = false } smallvec = { version = "1.10.0", default-features = false } stable_deref_trait = { version = "1.2.0", default-features = false } -twox-hash = { version = "1.4.2", default-features = false } +twox-hash = { version = "2.0.0", default-features = false, features = ["xxhash64"] } unicode-bidi = { version = "0.3.11", default-features = false } utf16_iter = { version = "1.0.2", default-features = false } utf8_iter = { version = "1.0.2", default-features = false } diff --git a/provider/blob/tests/test_versions.rs b/provider/blob/tests/test_versions.rs index 3288630ff53..11ad2c4d0c3 100644 --- a/provider/blob/tests/test_versions.rs +++ b/provider/blob/tests/test_versions.rs @@ -11,7 +11,6 @@ use icu_provider::prelude::*; use icu_provider_blob::export::*; use icu_provider_blob::BlobDataProvider; use std::collections::BTreeSet; -use std::hash::Hasher; const BLOB_V3: &[u8] = include_bytes!("data/v3.postcard"); @@ -134,9 +133,7 @@ fn test_format_bigger() { // Rather than check in a 10MB file, we just compute hashes println!("Computing hash ...."); // Construct a hasher with a random, stable seed - let mut hasher = twox_hash::XxHash64::with_seed(1234); - hasher.write(&blob); - let hash = hasher.finish(); + let hash = twox_hash::XxHash64::oneshot(1234, &blob); assert_eq!( hash, 9019763565456414394,