diff --git a/scopegraphs-macros/Cargo.toml b/scopegraphs-macros/Cargo.toml index 91818b7..46591df 100644 --- a/scopegraphs-macros/Cargo.toml +++ b/scopegraphs-macros/Cargo.toml @@ -18,7 +18,7 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -syn = { version = "2.0.29", features = ["full"] } +syn = { version = "2.0.29", features = [] } quote = "1.0.33" scopegraphs-regular-expressions = { path = "../scopegraphs-regular-expressions", features = ["rust-code-emitting", "dot"], version = "0.2.0" } proc-macro2 = "1.0.69" diff --git a/scopegraphs-regular-expressions/Cargo.toml b/scopegraphs-regular-expressions/Cargo.toml index 4b973df..8de7164 100644 --- a/scopegraphs-regular-expressions/Cargo.toml +++ b/scopegraphs-regular-expressions/Cargo.toml @@ -14,7 +14,7 @@ rust-version = "1.75" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -syn = { version = "2.0.29", features = ["full", "extra-traits"] } +syn = { version = "2.0.29", default-features = false, features = ["parsing"] } quote = { version = "1.0.33", optional = true } proc-macro2 = "1.0.69" thiserror = "1.0.50" diff --git a/scopegraphs-regular-expressions/src/regex.rs b/scopegraphs-regular-expressions/src/regex.rs index 3c7a4e3..cfd1a4c 100644 --- a/scopegraphs-regular-expressions/src/regex.rs +++ b/scopegraphs-regular-expressions/src/regex.rs @@ -5,15 +5,35 @@ use std::fmt::Debug; #[cfg(feature = "pretty-print")] use std::fmt::Display; use std::fmt::Formatter; +use std::hash::{Hash, Hasher}; use std::ops::Deref; use std::rc::Rc; use syn::Path; -#[derive(Hash, Debug, Clone, PartialEq, Eq)] pub struct Symbol { pub(super) name: Path, } +impl Eq for Symbol {} + +impl PartialEq for Symbol { + fn eq(&self, other: &Self) -> bool { + self.to_string() == other.to_string() + } +} + +impl Debug for Symbol { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + Display::fmt(self, f) + } +} + +impl Hash for Symbol { + fn hash(&self, state: &mut H) { + self.to_string().hash(state) + } +} + #[cfg(feature = "pretty-print")] impl Display for Symbol { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { diff --git a/scopegraphs/Cargo.toml b/scopegraphs/Cargo.toml index 9adbc6f..cf66646 100644 --- a/scopegraphs/Cargo.toml +++ b/scopegraphs/Cargo.toml @@ -15,6 +15,7 @@ rust-version = "1.75" [dependencies] futures = { version = "0.3.30", default-features = false, features = ["std"] } + bumpalo = "3.14.0" dot = { version = "0.1.4", optional = true } scopegraphs-prust-lib = { version = "0.1.0" } @@ -26,7 +27,7 @@ scopegraphs-regular-expressions = { path = "../scopegraphs-regular-expressions", [dev-dependencies] env_logger = "0.10.1" ctor = "0.2.5" -futures = { version = "0.3.30", default-features = false, features = ["std", "executor"] } +futures = { version = "0.3.30", default-features = false, features = ["alloc", "executor"] } [features] default = ["dot", "dynamic-regex"]