From 9f06254d13fef232b4f1b5bcf133d4bbede3e8f2 Mon Sep 17 00:00:00 2001 From: VitalyR Date: Tue, 31 Dec 2024 02:32:00 +0800 Subject: [PATCH] Replace `fxhash` with `rustc-hash` (#336) Co-authored-by: Max Willsey --- Cargo.toml | 2 +- src/pattern.rs | 2 +- src/util.rs | 4 ++-- tests/lambda.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0e75981..093d90c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ version = "0.9.5" [dependencies] env_logger = { version = "0.9.0", default-features = false } -fxhash = "0.2.1" +rustc-hash = "2.0.0" hashbrown = "0.15.2" indexmap = "2.7.0" quanta = "0.12" diff --git a/src/pattern.rs b/src/pattern.rs index 97b6f1ee..283c7878 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -57,7 +57,7 @@ use crate::*; /// // This is the search method from the Searcher trait /// let matches = same_add.search(&egraph); /// let matched_eclasses: Vec = matches.iter().map(|m| m.eclass).collect(); -/// assert_eq!(matched_eclasses, vec![a11, a22]); +/// assert_eq!(matched_eclasses, vec![a22, a11]); /// ``` /// /// [`FromStr`]: std::str::FromStr diff --git a/src/util.rs b/src/util.rs index c18f00b7..6c05c60d 100644 --- a/src/util.rs +++ b/src/util.rs @@ -4,7 +4,7 @@ use symbolic_expressions::Sexp; use fmt::{Debug, Display, Formatter}; #[cfg(feature = "serde-1")] -use ::serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; #[allow(unused_imports)] use crate::*; @@ -42,7 +42,7 @@ use crate::*; /// pub use symbol_table::GlobalSymbol as Symbol; -pub(crate) type BuildHasher = fxhash::FxBuildHasher; +pub(crate) type BuildHasher = rustc_hash::FxBuildHasher; // pub(crate) type HashMap = hashbrown::HashMap; // pub(crate) type HashSet = hashbrown::HashSet; diff --git a/tests/lambda.rs b/tests/lambda.rs index 80ea4fbd..2fbb65ca 100644 --- a/tests/lambda.rs +++ b/tests/lambda.rs @@ -1,5 +1,5 @@ use egg::{rewrite as rw, *}; -use fxhash::FxHashSet as HashSet; +use rustc_hash::FxHashSet as HashSet; define_language! { enum Lambda {