From 4e94a2696b537af09ce37091d9e1ec95fdf2cb7d Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 9 Oct 2022 12:46:16 -0700 Subject: feat(tvix/eval): From> for Value Signed-off-by: Adam Joseph Change-Id: I27615baf4104ab96600708b12a780599a3714bae Reviewed-on: https://cl.tvl.fyi/c/depot/+/6912 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/value/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tvix') 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 From for Value +where + T: Into, +{ + fn from(t: T) -> Self { + Self::String(t.into()) + } +} + /// Constructors impl Value { /// Construct a [`Value::Attrs`] from a [`NixAttrs`]. -- cgit 1.4.1