diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 531f217..69fd28c 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -29,4 +29,6 @@ jobs: with: tool: wasm-bindgen-cli - name: Run tests - run: cargo test --target wasm32-unknown-unknown --all \ No newline at end of file + run: cargo test --target wasm32-unknown-unknown --all + - name: Run tests with hashbrown + run: cargo test --target wasm32-unknown-unknown --features "hashbrown" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 389c78f..9ae589a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to the `dom_query` crate will be documented in this file. - Internal changes due to switch to `selectors` v0.26.0 switch. - `Selection` methods that required `&mut` now doesn't require `&mut`, finally. - Improve performance for `Document::from`, `Selection::select` and others. +- Switched from using `rustc-hash` to `foldhash`. ### Added - Added `Node::ancestors` method, that allows to get all or limited number of ancestors of a node. diff --git a/Cargo.toml b/Cargo.toml index dca493f..7dc0240 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ html5ever = "0.29.0" selectors = "0.26.0" cssparser = "0.34.0" tendril = "0.4.3" -rustc-hash = "2.0.0" -hashbrown = {version = "0.15.0", default-features = false, features = ["allocator-api2", "inline-more"], optional = true} +foldhash = "0.1.3" +hashbrown = {version = "0.15.0", default-features = false, features = ["allocator-api2", "inline-more", "default-hasher"], optional = true} precomputed-hash = "0.1.1" [dev-dependencies] diff --git a/src/entities.rs b/src/entities.rs index 3beb6e1..65f6bd0 100644 --- a/src/entities.rs +++ b/src/entities.rs @@ -3,17 +3,15 @@ #[cfg(feature = "hashbrown")] mod inline { use hashbrown::HashSet; - use rustc_hash::FxHasher; - use std::hash::BuildHasherDefault; - pub type NodeIdSet = HashSet>; - pub type HashSetFx = HashSet>; + pub type NodeIdSet = HashSet; + pub type HashSetFx = HashSet; } #[cfg(not(feature = "hashbrown"))] mod inline { - use rustc_hash::FxHashSet; - pub type NodeIdSet = FxHashSet; - pub type HashSetFx = FxHashSet; + use foldhash::HashSet; + pub type NodeIdSet = HashSet; + pub type HashSetFx = HashSet; } pub(crate) use inline::{HashSetFx, NodeIdSet};