diff options
author | Florian Klink <flokli@flokli.de> | 2024-12-09T09·14+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-12-09T14·51+0000 |
commit | 12c9db5a9a481782c82c18408923c9a5e707933b (patch) | |
tree | ba2c5776553fac3d35741c12d2ce0bd60fe887a5 /tvix | |
parent | adf9c47626a921f24382397808f8346835ea190a (diff) |
refactor(tvix/nix-daemon): use if let Some(_) = … r/8991
This makes it a bit less verbose. Change-Id: I41835f43628d7a10855b9d89816e8d20eb7546d2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12881 Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com> Reviewed-by: Domen Kožar <domen@cachix.org> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/nix-daemon/src/lib.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tvix/nix-daemon/src/lib.rs b/tvix/nix-daemon/src/lib.rs index 9a69ced1e5eb..5be8a0af7b79 100644 --- a/tvix/nix-daemon/src/lib.rs +++ b/tvix/nix-daemon/src/lib.rs @@ -42,16 +42,12 @@ impl NixDaemonIO for TvixDaemon { &self, path: &StorePath<String>, ) -> Result<Option<UnkeyedValidPathInfo>> { - match self.path_info_service.get(*path.digest()).await? { - Some(path_info) => { - if path_info.store_path.name() == path.name() { - Ok(Some(into_unkeyed_path_info(path_info))) - } else { - Ok(None) - } + if let Some(path_info) = self.path_info_service.get(*path.digest()).await? { + if path_info.store_path.name() == path.name() { + return Ok(Some(into_unkeyed_path_info(path_info))); } - None => Ok(None), } + Ok(None) } async fn query_path_from_hash_part(&self, hash: &[u8]) -> Result<Option<UnkeyedValidPathInfo>> { |