We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0508d8 commit ad85f92Copy full SHA for ad85f92
src/expression/mod.rs
@@ -43,6 +43,20 @@ pub struct Tree<'a> {
43
/// The comma-separated contents of the `(...)`, if any
44
pub args: Vec<Tree<'a>>,
45
}
46
+
47
+impl PartialEq for Tree<'_> {
48
+ fn eq(&self, other: &Self) -> bool {
49
+ let mut stack = vec![(self, other)];
50
+ while let Some((me, you)) = stack.pop() {
51
+ if me.name != you.name || me.args.len() != you.args.len() {
52
+ return false;
53
+ }
54
+ stack.extend(me.args.iter().zip(you.args.iter()));
55
56
+ true
57
58
+}
59
+impl Eq for Tree<'_> {}
60
// or_b(pk(A),pk(B))
61
//
62
// A = musig(musig(B,C),D,E)
0 commit comments