From 3aec6786798d6ffd5e5eb5b205827b92b6185f1d Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 25 Oct 2022 13:07:21 -0700 Subject: docs(tvix/eval): warn that AttrsRep::KV is not for Key-Value pairs I assumed that AttrsRep::KV represented attrsets with a single attribute as a Key-Value pair. That is not the case. Let's warn other people about this. Signed-off-by: Adam Joseph Change-Id: Ie3d2765fcc1ab705c153ab94ffe77bbd6d4ab39e Reviewed-on: https://cl.tvl.fyi/c/depot/+/7093 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index c0f82b921449..ca4d17178a5e 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -23,7 +23,14 @@ mod tests; enum AttrsRep { Empty, Map(BTreeMap), - KV { name: Value, value: Value }, + + /// Warning: this represents a **two**-attribute attrset, with + /// attribute names "name" and "value", like `{name="foo"; + /// value="bar";}`, *not* `{foo="bar";}`! + KV { + name: Value, + value: Value, + }, } impl AttrsRep { -- cgit 1.4.1