Fixed unhandled case in

This commit is contained in:
Pranav Gaddamadugu 2021-09-20 20:00:07 -07:00
parent 5f22a21f47
commit 3cc9367d09

View File

@ -412,10 +412,18 @@ impl<'a, F: PrimeField, G: GroupType<F>> ConstraintSynthesizer<F> for Compiler<'
// Helper function to recursively filter keys from AST JSON
fn remove_key_from_json(value: &mut serde_json::Value, key: &str) {
if let serde_json::value::Value::Object(map) = value {
match value {
serde_json::value::Value::Object(map) => {
map.remove(key);
for val in map.values_mut() {
remove_key_from_json(val, key);
}
}
serde_json::value::Value::Array(values) => {
for val in values.iter_mut() {
remove_key_from_json(val, key);
}
}
_ => (),
}
}