From 84a8ed265ce1f6287bfae0f5196950695c9a45f0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 14 Mar 2023 19:32:26 +0100 Subject: refactor(tvix/nix-compat): remove manual map Change-Id: I1652e24c9be28112d98683de2d2db51dc46001ed Reviewed-on: https://cl.tvl.fyi/c/depot/+/8302 Reviewed-by: tazjin Autosubmit: flokli Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/mod.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tvix/nix-compat') diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs index c0f0ba169684..2b549536b247 100644 --- a/tvix/nix-compat/src/derivation/mod.rs +++ b/tvix/nix-compat/src/derivation/mod.rs @@ -85,15 +85,13 @@ impl Derivation { return None; } - match self.outputs.get("out") { - #[allow(clippy::manual_map)] - Some(out_output) => match &out_output.hash { - Some(out_output_hash) => Some((&out_output.path, out_output_hash)), - // There has to be a hash, otherwise it would not be FOD - None => None, - }, - None => None, + if let Some(out_output) = self.outputs.get("out") { + if let Some(out_output_hash) = &out_output.hash { + return Some((&out_output.path, out_output_hash)); + } + // There has to be a hash, otherwise it would not be FOD } + return None; } /// Returns the drv path of a Derivation struct. -- cgit 1.4.1