From 31973890a9ee60f50c1426ef7173bd4238234268 Mon Sep 17 00:00:00 2001 From: Jürgen Hahn Date: Mon, 2 Jan 2023 21:00:59 +0100 Subject: refactor(tvix/derivation): refactor the derivation serialization This refactors the code to serialize a derivation. The original code has beed moved to seperate crates for better code structure. Change-Id: I3b1a6b134428fcbc9930c330bced8ec3610cfb4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7733 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/derivation/src/tests/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/derivation/src/tests/mod.rs') diff --git a/tvix/derivation/src/tests/mod.rs b/tvix/derivation/src/tests/mod.rs index 9c8ffd061c11..800806926976 100644 --- a/tvix/derivation/src/tests/mod.rs +++ b/tvix/derivation/src/tests/mod.rs @@ -1,4 +1,4 @@ -use super::{serialize_derivation, Derivation}; +use crate::derivation::Derivation; use std::fs::File; use std::io::Read; use std::path::Path; @@ -19,7 +19,7 @@ fn assert_derivation_ok(path_to_drv_file: &str) { let derivation: Derivation = serde_json::from_str(&data).expect("JSON was not well-formatted"); let mut serialized_derivation = String::new(); - serialize_derivation(derivation, &mut serialized_derivation).unwrap(); + derivation.serialize(&mut serialized_derivation).unwrap(); let expected = read_file(path_to_drv_file); -- cgit 1.4.1