feat(tvix/eval): From<Into<NixString>> for Value

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>
This commit is contained in:
Adam Joseph 2022-10-09 12:46:16 -07:00
parent 2e0a4aaa84
commit 4e94a2696b

View file

@ -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`].