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
|
|
@ -561,7 +561,7 @@ impl PodProver for Prover {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct MainPod {
|
||||
params: Params,
|
||||
id: PodId,
|
||||
|
|
@ -676,6 +676,17 @@ impl Pod for MainPod {
|
|||
})
|
||||
.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::<MainPod>() {
|
||||
self == other
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RecursivePod for MainPod {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ use crate::{
|
|||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Statement(pub Predicate, pub Vec<StatementArg>);
|
||||
|
||||
impl Eq for Statement {}
|
||||
|
||||
impl Statement {
|
||||
pub fn is_none(&self) -> bool {
|
||||
self.0 == Predicate::Native(NativePredicate::None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue