From dcbcac89559e128c70edbd39a6a5566386aee286 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 18 May 2023 21:49:30 +0300 Subject: refactor(tvix/nix-compat): clippy Change-Id: Ie5277a5c15d9dfe543ca41fa7c6a1eedf22a9f64 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8593 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/mod.rs | 14 ++++++-------- tvix/nix-compat/src/store_path/utils.rs | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs index f3a4cd6b04..ab14711655 100644 --- a/tvix/nix-compat/src/derivation/mod.rs +++ b/tvix/nix-compat/src/derivation/mod.rs @@ -209,14 +209,12 @@ impl Derivation { |e| DerivationError::InvalidOutputDerivationPath(output_name.to_string(), e), )? } else { - build_output_path(derivation_or_fod_hash, &output_name, &path_name).map_err( - |e| { - DerivationError::InvalidOutputDerivationPath( - output_name.to_string(), - store_path::BuildStorePathError::InvalidName(e), - ) - }, - )? + build_output_path(derivation_or_fod_hash, output_name, &path_name).map_err(|e| { + DerivationError::InvalidOutputDerivationPath( + output_name.to_string(), + store_path::BuildStorePathError::InvalidName(e), + ) + })? }; output.path = abs_store_path.to_absolute_path(); diff --git a/tvix/nix-compat/src/store_path/utils.rs b/tvix/nix-compat/src/store_path/utils.rs index c5fc48a94f..fd3785568b 100644 --- a/tvix/nix-compat/src/store_path/utils.rs +++ b/tvix/nix-compat/src/store_path/utils.rs @@ -122,7 +122,7 @@ pub fn build_output_path( build_store_path_from_fingerprint_parts( &(String::from("output:") + output_name), drv_hash, - &output_path_name, + output_path_name, ) } @@ -142,7 +142,7 @@ fn build_store_path_from_fingerprint_parts( let fingerprint = String::from(ty) + ":" + &hash.to_nix_hash_string() + ":" + STORE_DIR + ":" + name; let digest = { - let hasher = Sha256::new_with_prefix(&fingerprint); + let hasher = Sha256::new_with_prefix(fingerprint); hasher.finalize() }; let compressed = compress_hash::<20>(&digest); -- cgit 1.4.1