Skip to main content

append_to_object_array

Function append_to_object_array 

Source
pub fn append_to_object_array(obj: &mut Value, key: &Value, v: Value)
Expand description

obj[key].push(v) — append to an array field of a dict in place. The transpiled dict['bids'].push(x) otherwise lowers to append_to_array(&mut get_value(&dict, &key), x), whose get_value yields a COW clone, so the push is lost (paradex’s order-book inserts). Mutate the field through the dict instead.