Skip to content

Commit

Permalink
feat: use educe to implement Hash for Ident
Browse files Browse the repository at this point in the history
  • Loading branch information
bing committed Jun 10, 2024
1 parent cfb3808 commit 6a03afe
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ark-ff = "0.3.0"
ark-bls12-381 = "0.3.0" # bls12-381 curve for r1cs backend
ark-bn254 = "0.3.0" # bn128 curve for r1cs backend
ark-serialize = "0.3.0" # serialization of arkworks types
educe = { version = "0.6", default-features = false, features = ["Hash"] }
ena = "0.14.0" # union-find implementation for the wiring
num-bigint = "0.4.3" # big int library
camino = "1.1.1" # to replace Path and PathBuf
Expand Down
5 changes: 4 additions & 1 deletion src/parser/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use educe::Educe;
use std::{
fmt::Display,
hash::{Hash, Hasher},
Expand Down Expand Up @@ -392,9 +393,11 @@ impl FnSig {
}

/// Any kind of text that can represent a type, a variable, a function name, etc.
#[derive(Debug, Default, Clone, Eq, Hash, Serialize, Deserialize)]
#[derive(Debug, Default, Clone, Eq, Serialize, Deserialize, Educe)]
#[educe(Hash)]
pub struct Ident {
pub value: String,
#[educe(Hash(ignore))]
pub span: Span,
}

Expand Down

0 comments on commit 6a03afe

Please sign in to comment.