From a10d1e7bdfedbaff08a2ad1caf4014e9936afd4f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 31 Jul 2023 23:28:00 +0200 Subject: refactor(tvix/nix-compat): use local write::*; Change-Id: I43cc1d5b3419255f815490b2e10f05db19e3bffc Reviewed-on: https://cl.tvl.fyi/c/depot/+/9000 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: raitobezarius --- tvix/nix-compat/src/derivation/mod.rs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'tvix/nix-compat/src') diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs index 6ee42bb3ed96..318f2cc1ae99 100644 --- a/tvix/nix-compat/src/derivation/mod.rs +++ b/tvix/nix-compat/src/derivation/mod.rs @@ -47,30 +47,32 @@ impl Derivation { /// /// The only errors returns are these when writing to the passed writer. pub fn serialize(&self, writer: &mut impl std::io::Write) -> Result<(), io::Error> { + use write::*; + writer.write_all(write::DERIVATION_PREFIX.as_bytes())?; - write::write_char(writer, write::PAREN_OPEN)?; + write_char(writer, write::PAREN_OPEN)?; - write::write_outputs(writer, &self.outputs)?; - write::write_char(writer, write::COMMA)?; + write_outputs(writer, &self.outputs)?; + write_char(writer, COMMA)?; - write::write_input_derivations(writer, &self.input_derivations)?; - write::write_char(writer, write::COMMA)?; + write_input_derivations(writer, &self.input_derivations)?; + write_char(writer, COMMA)?; - write::write_input_sources(writer, &self.input_sources)?; - write::write_char(writer, write::COMMA)?; + write_input_sources(writer, &self.input_sources)?; + write_char(writer, COMMA)?; - write::write_system(writer, &self.system)?; - write::write_char(writer, write::COMMA)?; + write_system(writer, &self.system)?; + write_char(writer, COMMA)?; - write::write_builder(writer, &self.builder)?; - write::write_char(writer, write::COMMA)?; + write_builder(writer, &self.builder)?; + write_char(writer, COMMA)?; - write::write_arguments(writer, &self.arguments)?; - write::write_char(writer, write::COMMA)?; + write_arguments(writer, &self.arguments)?; + write_char(writer, COMMA)?; - write::write_enviroment(writer, &self.environment)?; + write_enviroment(writer, &self.environment)?; - write::write_char(writer, write::PAREN_CLOSE)?; + write_char(writer, PAREN_CLOSE)?; Ok(()) } -- cgit 1.4.1