diff options
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 12 | ||||
-rw-r--r-- | tvix/eval/src/value/string/mod.rs | 9 |
2 files changed, 1 insertions, 20 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 47c0f85b3c1b..0e5d1363fe8b 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -1498,17 +1498,7 @@ mod pure_builtins { let mut buf: Vec<u8> = vec![]; let context = to_xml::value_to_xml(&mut buf, &value)?; - Ok(( - buf, - // FUTUREWORK: We have a distinction between an empty context, and - // no context at all. Fix this. - if !context.is_empty() { - Some(Box::new(context)) - } else { - None - }, - ) - .into()) + Ok(NixString::new_context_from(context, buf).into()) } #[builtin("trace")] diff --git a/tvix/eval/src/value/string/mod.rs b/tvix/eval/src/value/string/mod.rs index 5bcb4786b283..0f41ce9dc73c 100644 --- a/tvix/eval/src/value/string/mod.rs +++ b/tvix/eval/src/value/string/mod.rs @@ -455,15 +455,6 @@ impl From<String> for NixString { } } -impl<T> From<(T, Option<Box<NixContext>>)> for NixString -where - NixString: From<T>, -{ - fn from((s, ctx): (T, Option<Box<NixContext>>)) -> Self { - Self::new(NixString::from(s).as_ref(), ctx) - } -} - impl From<Box<str>> for NixString { fn from(s: Box<str>) -> Self { s.into_boxed_bytes().into() |