From df73d5f242e3b737d356546450dc883214c14b37 Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Mon, 19 Feb 2024 19:19:39 +0700 Subject: refactor(tvix/nix-compat): Restrict visibility Towards https://b.tvl.fyi/issues/264 Change-Id: I323907cb842ed10ddd05b72c285c598b60d213e0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10972 Reviewed-by: flokli Autosubmit: Peter Kolloch Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/write.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'tvix') diff --git a/tvix/nix-compat/src/derivation/write.rs b/tvix/nix-compat/src/derivation/write.rs index 0981dfccae22..e6df40424ea7 100644 --- a/tvix/nix-compat/src/derivation/write.rs +++ b/tvix/nix-compat/src/derivation/write.rs @@ -65,7 +65,7 @@ fn write_array_elements>( Ok(()) } -pub fn write_outputs( +pub(crate) fn write_outputs( writer: &mut impl Write, outputs: &BTreeMap, ) -> Result<(), io::Error> { @@ -99,7 +99,7 @@ pub fn write_outputs( Ok(()) } -pub fn write_input_derivations( +pub(crate) fn write_input_derivations( writer: &mut impl Write, input_derivations: &BTreeMap>, ) -> Result<(), io::Error> { @@ -132,7 +132,7 @@ pub fn write_input_derivations( Ok(()) } -pub fn write_input_sources( +pub(crate) fn write_input_sources( writer: &mut impl Write, input_sources: &BTreeSet, ) -> Result<(), io::Error> { @@ -146,17 +146,20 @@ pub fn write_input_sources( Ok(()) } -pub fn write_system(writer: &mut impl Write, platform: &str) -> Result<(), Error> { +pub(crate) fn write_system(writer: &mut impl Write, platform: &str) -> Result<(), Error> { write_field(writer, platform, true)?; Ok(()) } -pub fn write_builder(writer: &mut impl Write, builder: &str) -> Result<(), Error> { +pub(crate) fn write_builder(writer: &mut impl Write, builder: &str) -> Result<(), Error> { write_field(writer, builder, true)?; Ok(()) } -pub fn write_arguments(writer: &mut impl Write, arguments: &[String]) -> Result<(), io::Error> { +pub(crate) fn write_arguments( + writer: &mut impl Write, + arguments: &[String], +) -> Result<(), io::Error> { write_char(writer, BRACKET_OPEN)?; write_array_elements( writer, @@ -170,7 +173,10 @@ pub fn write_arguments(writer: &mut impl Write, arguments: &[String]) -> Result< Ok(()) } -pub fn write_environment(writer: &mut impl Write, environment: E) -> Result<(), io::Error> +pub(crate) fn write_environment( + writer: &mut impl Write, + environment: E, +) -> Result<(), io::Error> where E: IntoIterator, K: AsRef<[u8]>, -- cgit 1.4.1