From a14880903cb63f80d857cb4062bbbc099c12c69e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 14 Mar 2023 20:52:21 +0100 Subject: refactor(tvix/nix-compat): rename helper func This only trims the output paths from a Derivation struct, not the output hashes. Change-Id: I9250fec4602ed05bb64540c4a89ddb6fb052be1f Reviewed-on: https://cl.tvl.fyi/c/depot/+/8303 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: flokli --- tvix/nix-compat/src/derivation/tests/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/nix-compat/src') diff --git a/tvix/nix-compat/src/derivation/tests/mod.rs b/tvix/nix-compat/src/derivation/tests/mod.rs index 2b5b8343201a..7f94f5e690ce 100644 --- a/tvix/nix-compat/src/derivation/tests/mod.rs +++ b/tvix/nix-compat/src/derivation/tests/mod.rs @@ -70,9 +70,9 @@ fn derivation_path(name: &str, expected_path: &str) { ); } -/// This trims all outputs from a Derivation struct, +/// This trims all output paths from a Derivation struct, /// by setting outputs[$outputName].path and environment[$outputName] to the empty string. -fn derivation_with_trimmed_outputs(derivation: &Derivation) -> Derivation { +fn derivation_with_trimmed_output_paths(derivation: &Derivation) -> Derivation { let mut trimmed_env = derivation.environment.clone(); let mut trimmed_outputs = derivation.outputs.clone(); @@ -120,7 +120,7 @@ fn output_paths(name: &str, drv_path: &str) { let data = read_file(&format!("{}/{}.json", RESOURCES_PATHS, drv_path)); let expected_derivation: Derivation = serde_json::from_str(&data).expect("must deserialize"); - let mut derivation = derivation_with_trimmed_outputs(&expected_derivation); + let mut derivation = derivation_with_trimmed_output_paths(&expected_derivation); // calculate the derivation_or_fod_hash of derivation // We don't expect the lookup function to be called for most derivations. -- cgit 1.4.1