From 1d59d3ba8f0f77d33e246984447c0ae5b3889316 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 7 Jan 2023 14:37:50 +0300 Subject: fix(tvix/eval): fix last uses of Vec -> NixList in builtins Change-Id: I0d71b82eb7ddc1e457b0996b0668006f55f56751 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7790 Autosubmit: tazjin Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/value/mod.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'tvix/eval/src/value') diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index b5585923a301..49ab62fd180e 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -542,12 +542,6 @@ impl From for Value { } } -impl From> for Value { - fn from(val: Vec) -> Self { - Self::List(NixList::from_vec(val)) - } -} - impl TryFrom for Value { type Error = ErrorKind; @@ -568,11 +562,12 @@ impl TryFrom for Value { } } serde_json::Value::String(s) => Ok(s.into()), - serde_json::Value::Array(a) => Ok(a - .into_iter() - .map(Value::try_from) - .collect::, _>>()? - .into()), + serde_json::Value::Array(a) => Ok(Value::List( + a.into_iter() + .map(Value::try_from) + .collect::, _>>()? + .into(), + )), serde_json::Value::Object(obj) => { match (obj.len(), obj.get("name"), obj.get("value")) { (2, Some(name), Some(value)) => Ok(Self::attrs(NixAttrs::from_kv( -- cgit 1.4.1