From 8c7d5b4f87e9394dd3acff830e99bce0303b34e6 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 26 Feb 2023 17:56:08 +0300 Subject: chore(tvix/eval): implement From> for NixAttrs Again simplifying some code down the line, where bits of code that construct attribute sets already have the final structure available. Change-Id: I0bb7a1daa63298122b51be73d35d695a4f73f8b0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8140 Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tvix') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 9b7a683ce3f7..b9c5adba19b8 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -94,6 +94,12 @@ impl AttrsRep { #[derive(Clone, Debug, Default)] pub struct NixAttrs(pub(super) AttrsRep); +impl From> for NixAttrs { + fn from(map: OrdMap) -> Self { + NixAttrs(AttrsRep::Im(map)) + } +} + impl FromIterator<(K, V)> for NixAttrs where NixString: From, -- cgit 1.4.1