about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-10T16·09+0300
committertazjin <tazjin@tvl.su>2022-08-24T21·25+0000
commit5685f7c59402439af33f7b6fc1114557f0c33477 (patch)
tree01dcd1e3df84249c659d5371aaf2ce104fa60af8 /tvix/eval/src/value/attrs.rs
parent92c53fe982560248dc7655a5605db5e3cfc35d04 (diff)
fix(tvix/value): add ident_str representation of strings r/4462
When printing strings as identifiers (in attribute sets), the string
should only be quoted and escaped if it contains escape characters.

Change-Id: If2bcfa1e93dc8f00be4d7a57ec1d82fc679103c3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6127
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/value/attrs.rs')
-rw-r--r--tvix/eval/src/value/attrs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index 7e3b5f231d66..d04e01bf7eab 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -37,7 +37,7 @@ impl Display for NixAttrs {
 
             NixAttrs::Map(map) => {
                 for (name, value) in map {
-                    f.write_fmt(format_args!("{} = {}; ", name, value))?;
+                    f.write_fmt(format_args!("{} = {}; ", name.ident_str(), value))?;
                 }
             }