about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-10-09T19·46-0700
committerAdam Joseph <adam@westernsemico.com>2022-10-12T04·23+0000
commit4e94a2696b537af09ce37091d9e1ec95fdf2cb7d (patch)
tree2f84c0074f2c6a45236761eea4373a535c5bc2e8 /tvix/eval
parent2e0a4aaa8468418065ff225da18142675a96b82e (diff)
feat(tvix/eval): From<Into<NixString>> for Value r/5110
Signed-off-by: Adam Joseph <adam@westernsemico.com>
Change-Id: I27615baf4104ab96600708b12a780599a3714bae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6912
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/value/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index 3791aaf56b9b..a547ddd4dd69 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -115,6 +115,15 @@ impl<'a> Deref for ForceResult<'a> {
     }
 }
 
+impl<T> From<T> for Value
+where
+    T: Into<NixString>,
+{
+    fn from(t: T) -> Self {
+        Self::String(t.into())
+    }
+}
+
 /// Constructors
 impl Value {
     /// Construct a [`Value::Attrs`] from a [`NixAttrs`].