diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2022-12-24T17·18+0100 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2023-01-10T09·53+0000 |
commit | 805219a2fad0edac10d046fc5ad5820edb4482ee (patch) | |
tree | 2ab7e081c93910875071fc74ad709a2bbc400217 /tvix/eval/src/builtins/mod.rs | |
parent | c011a6130cd4f0486539f8e98f0aef5d64e32d90 (diff) |
feat(tvix/eval): implement serde::Deserialize for Value r/5640
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
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 770dfe5ba2f8..9c9d171a2102 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -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")] |