From adff7be4d15e9c038e1600559d5d7226023c3c73 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 23 Jan 2024 14:30:48 +0200 Subject: feat(tvix/eval): expose value_to_xml for test cases It's debateable on whether the serialization code should be exposed a bit more prominently or not. Change-Id: Iff7a28f884b1490b12b145dfdadbedacb84fd387 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10684 Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: tazjin --- tvix/eval/src/builtins/mod.rs | 3 +++ tvix/eval/src/builtins/to_xml.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 81d30e91c689..dc3ea3fc15d4 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -27,6 +27,9 @@ use self::versions::{VersionPart, VersionPartsIter}; mod to_xml; mod versions; +#[cfg(test)] +pub use to_xml::value_to_xml; + #[cfg(feature = "impure")] mod impure; diff --git a/tvix/eval/src/builtins/to_xml.rs b/tvix/eval/src/builtins/to_xml.rs index 6d486d356518..250891b60d99 100644 --- a/tvix/eval/src/builtins/to_xml.rs +++ b/tvix/eval/src/builtins/to_xml.rs @@ -11,7 +11,7 @@ use crate::{ErrorKind, Value}; /// Recursively serialise a value to XML. The value *must* have been /// deep-forced before being passed to this function. -pub(super) fn value_to_xml(mut writer: W, value: &Value) -> Result<(), ErrorKind> { +pub fn value_to_xml(mut writer: W, value: &Value) -> Result<(), ErrorKind> { let config = EmitterConfig { perform_indent: true, pad_self_closing: true, -- cgit 1.4.1