about summary refs log tree commit diff
path: root/tvix/eval/src/value/mod.rs
diff options
context:
space:
mode:
authorLyle Mantooth <lyle@menteeth.us>2022-12-03T05·18-0500
committerclbot <clbot@tvl.fyi>2022-12-03T13·26+0000
commitf4e17caae88a1180444d8120ba35565e9853199d (patch)
treed16b895a642f35bb4544541eceb71cfe9a1d9014 /tvix/eval/src/value/mod.rs
parent9fed61297a9766be4e5bd4c0a4461cfb176115c9 (diff)
feat(tvix/eval): Continue removing leakage of BTreeMap. r/5379
Fixes b/212. Based on feedback in https://cl.tvl.fyi/c/depot/+/7492, all
uses of `NixAttrs::from_map` have been removed. Only `from_iter` and
`from_kv` remain.

Change-Id: I52e25f73018c2aa1843197427516b7a852503e2c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7500
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: IslandUsurper <lyle@menteeth.us>
Diffstat (limited to 'tvix/eval/src/value/mod.rs')
-rw-r--r--tvix/eval/src/value/mod.rs5
1 files changed, 3 insertions, 2 deletions
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(),
                     ))),
                 }
             }