feat(tvix/eval): implement serde::Deserialize for Value

Co-Authored-By: Vincent Ambo <tazjin@tvl.su>

Change-Id: Ib6f7d1f4f4faac36b44f5f75cccc57bf912cf606
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7626
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Ryan Lahfa 2022-12-24 18:18:26 +01:00 committed by tazjin
parent c011a6130c
commit 805219a2fa
10 changed files with 114 additions and 50 deletions

View file

@ -339,8 +339,8 @@ mod pure_builtins {
#[builtin("fromJSON")]
fn builtin_from_json(_: &mut VM, json: Value) -> Result<Value, ErrorKind> {
let json_str = json.to_str()?;
let json: serde_json::Value = serde_json::from_str(&json_str)?;
json.try_into()
serde_json::from_str(&json_str).map_err(|err| err.into())
}
#[builtin("genericClosure")]