add eq & partial_eq for RecursivePod, Pod traits and VDSet struct (for usage from introduction-pods) (#309)
* add eq & partial_eq for VDSet (for usage from introduction-pods) * add eq & partial_eq impls for Pod & RecursivePod traits
This commit is contained in:
parent
256d76ae34
commit
e1775d8578
10 changed files with 121 additions and 9 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use std::{
|
||||
any::Any,
|
||||
collections::HashMap,
|
||||
sync::{LazyLock, Mutex},
|
||||
};
|
||||
|
|
@ -73,7 +74,7 @@ impl EmptyPodVerifyTarget {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct EmptyPod {
|
||||
params: Params,
|
||||
id: PodId,
|
||||
|
|
@ -192,6 +193,17 @@ impl Pod for EmptyPod {
|
|||
})
|
||||
.expect("serialization to json")
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
fn equals(&self, other: &dyn Pod) -> bool {
|
||||
if let Some(other) = other.as_any().downcast_ref::<EmptyPod>() {
|
||||
self == other
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RecursivePod for EmptyPod {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue