diff options
Diffstat (limited to 'tvix/eval/src/value/attrs.rs')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 319f6bdfa9bb..4109691992ca 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -259,6 +259,14 @@ 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)) + } } // In Nix, name/value attribute pairs are frequently constructed from |