about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-02-27T10·32+0300
committertazjin <tazjin@tvl.su>2023-03-13T20·30+0000
commit1941082cbb4aa977bc5210516536efdbf96b927c (patch)
tree3423c0972eb8a4da12c157ccecb2abafd46ed5ff /tvix/eval/src/value/attrs
parent4bbfeaf1cbf6f0d1ea94c0fc405512259e856e0a (diff)
refactor(tvix/eval): simplify NixString representation(s) r/5967
Instead of the two different representations (which we don't really
use much), use a `Box<str>` (which potentially shaves another 8 bytes
off `Value`).

NixString values themselves are immutable anyways (which was a
guarantee we already had with `SmolStr`), so this doesn't change
anything else.

Change-Id: I1d8454c056c21ecb0aebc473cfb3ae06cd70dbb6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8151
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/attrs')
-rw-r--r--tvix/eval/src/value/attrs/tests.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/value/attrs/tests.rs b/tvix/eval/src/value/attrs/tests.rs
index 39ac55b6799a..473592c519df 100644
--- a/tvix/eval/src/value/attrs/tests.rs
+++ b/tvix/eval/src/value/attrs/tests.rs
@@ -84,10 +84,10 @@ fn test_kv_attrs_iter() {
         .into_iter()
         .map(|(k, v)| (k, v));
     let (k, v) = iter.next().unwrap();
-    assert!(k == NixString::NAME_REF);
+    assert!(k == *NAME_REF);
     assert!(v.to_str().unwrap() == meaning_val.to_str().unwrap());
     let (k, v) = iter.next().unwrap();
-    assert!(k == NixString::VALUE_REF);
+    assert!(k == *VALUE_REF);
     assert!(v.as_int().unwrap() == forty_two_val.as_int().unwrap());
     assert!(iter.next().is_none());
 }