summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar dtzxporter <dtzxporter@users.noreply.github.com>2023-09-12 18:15:00 -0400
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-11 03:40:22 +0100
commit98e088e731e6fbd5b5035033ae61bda823ced988 (patch)
tree4e12f49f37ad6d5c6dffd06bc7fabc05930db3e1 /core
parent751ea77c29f6eb3d00f45f0a04c833a1d03a425c (diff)
downloadiced-98e088e731e6fbd5b5035033ae61bda823ced988.tar.gz
iced-98e088e731e6fbd5b5035033ae61bda823ced988.tar.bz2
iced-98e088e731e6fbd5b5035033ae61bda823ced988.zip
Migrate twox-hash -> xxhash_rust. Switch to Xxh3 for better performance.
xxhash-rust is more maintained, built against `::core`, so no workaround for wasm is necessary. Switch to Xxh3 for better performance, which shows when loading/hashing image buffers.
Diffstat (limited to 'core')
-rw-r--r--core/Cargo.toml2
-rw-r--r--core/src/hasher.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 7acb7511..82946847 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -14,7 +14,7 @@ keywords.workspace = true
bitflags.workspace = true
log.workspace = true
thiserror.workspace = true
-twox-hash.workspace = true
+xxhash-rust.workspace = true
num-traits.workspace = true
palette.workspace = true
diff --git a/core/src/hasher.rs b/core/src/hasher.rs
index 9d8f75b3..a13d78af 100644
--- a/core/src/hasher.rs
+++ b/core/src/hasher.rs
@@ -1,6 +1,7 @@
/// The hasher used to compare layouts.
-#[derive(Debug, Default)]
-pub struct Hasher(twox_hash::XxHash64);
+#[allow(missing_debug_implementations)] // Doesn't really make sense to have debug on the hasher state anyways.
+#[derive(Default)]
+pub struct Hasher(xxhash_rust::xxh3::Xxh3);
impl core::hash::Hasher for Hasher {
fn write(&mut self, bytes: &[u8]) {