diff options
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 8 | ||||
-rw-r--r-- | tvix/eval/src/value/mod.rs | 5 |
2 files changed, 3 insertions, 10 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 0ef28f068cf2..ecce34fb4af4 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -345,14 +345,6 @@ impl NixAttrs { Ok(attrs) } - /// Construct an attribute set directly from a BTreeMap - /// representation. This is only visible inside of the crate, as - /// it is intended exclusively for use with the construction of - /// global sets for the compiler. - pub(crate) fn from_map(map: BTreeMap<NixString, Value>) -> Self { - NixAttrs(AttrsRep::Map(map)) - } - /// Construct an optimized "KV"-style attribute set given the value for the /// `"name"` key, and the value for the `"value"` key pub(crate) fn from_kv(name: Value, value: Value) -> Self { diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index f0e3b84b9251..2bca9e6d3202 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -526,10 +526,11 @@ impl TryFrom<serde_json::Value> for Value { name.clone().try_into()?, value.clone().try_into()?, ))), - _ => Ok(Self::attrs(NixAttrs::from_map( + _ => Ok(Self::attrs(NixAttrs::from_iter( obj.into_iter() .map(|(k, v)| Ok((k.into(), v.try_into()?))) - .collect::<Result<_, ErrorKind>>()?, + .collect::<Result<Vec<(NixString, Value)>, ErrorKind>>()? + .into_iter(), ))), } } |