diff options
author | Florian Klink <flokli@flokli.de> | 2023-03-14T18·32+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-03-14T20·53+0000 |
commit | 84a8ed265ce1f6287bfae0f5196950695c9a45f0 (patch) | |
tree | 6e88f02df86f4db901a6d217a2955076ee4a781e /tvix/nix-compat/src/derivation/mod.rs | |
parent | c699ace11bd8541cd9dd7cdd4b096498c566a489 (diff) |
refactor(tvix/nix-compat): remove manual map r/5999
Change-Id: I1652e24c9be28112d98683de2d2db51dc46001ed Reviewed-on: https://cl.tvl.fyi/c/depot/+/8302 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/derivation/mod.rs')
-rw-r--r-- | tvix/nix-compat/src/derivation/mod.rs | 14 |
1 files changed, 6 insertions, 8 deletions
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. |