Skip to content

Commit

Permalink
greatly improve compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed Apr 24, 2024
1 parent 90e139e commit fb705f1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scopegraphs-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion scopegraphs-regular-expressions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 21 additions & 1 deletion scopegraphs-regular-expressions/src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<H: Hasher>(&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 {
Expand Down
3 changes: 2 additions & 1 deletion scopegraphs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -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"]
Expand Down

0 comments on commit fb705f1

Please sign in to comment.