Add cases to desugar function for container update ops (#425)
* Add cases to desugar function for container update ops * Make point hashable
This commit is contained in:
parent
6dcd17cc37
commit
5a80fba618
2 changed files with 30 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ fn ec_field_from_bytes(b: &[u8]) -> Result<ECField, Error> {
|
||||||
Ok(QuinticExtension(array::from_fn(|i| fields[i])))
|
Ok(QuinticExtension(array::from_fn(|i| fields[i])))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||||
pub struct Point {
|
pub struct Point {
|
||||||
pub x: ECField,
|
pub x: ECField,
|
||||||
pub u: ECField,
|
pub u: ECField,
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,35 @@ impl StatementTmplBuilder {
|
||||||
args: new_args,
|
args: new_args,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Predicate::Native(NativePredicate::DictInsert) => StatementTmplBuilder {
|
||||||
|
predicate: Predicate::Native(NativePredicate::ContainerInsert),
|
||||||
|
args: self.args,
|
||||||
|
},
|
||||||
|
Predicate::Native(NativePredicate::SetInsert) => {
|
||||||
|
let mut new_args = self.args.clone();
|
||||||
|
new_args.push(self.args[2].clone());
|
||||||
|
StatementTmplBuilder {
|
||||||
|
predicate: Predicate::Native(NativePredicate::ContainerInsert),
|
||||||
|
args: new_args,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Predicate::Native(NativePredicate::DictUpdate)
|
||||||
|
| Predicate::Native(NativePredicate::ArrayUpdate) => StatementTmplBuilder {
|
||||||
|
predicate: Predicate::Native(NativePredicate::ContainerUpdate),
|
||||||
|
args: self.args,
|
||||||
|
},
|
||||||
|
Predicate::Native(NativePredicate::DictDelete) => StatementTmplBuilder {
|
||||||
|
predicate: Predicate::Native(NativePredicate::ContainerDelete),
|
||||||
|
args: self.args,
|
||||||
|
},
|
||||||
|
Predicate::Native(NativePredicate::SetDelete) => {
|
||||||
|
let mut new_args = self.args.clone();
|
||||||
|
new_args.push(self.args[2].clone());
|
||||||
|
StatementTmplBuilder {
|
||||||
|
predicate: Predicate::Native(NativePredicate::ContainerDelete),
|
||||||
|
args: new_args,
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => self,
|
_ => self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue