From d0ef6a50df6760702bf970c0cee71a5cdbff21b8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 27 Jun 2024 00:54:09 +0300 Subject: refactor(tvix/castore/blobsvc): inline things a bit Get rid of the `let grpc_client` and `let resp` in some cases. Change-Id: Idc1c0f566a3b1b48da62e6f1977b07620656b16c Reviewed-on: https://cl.tvl.fyi/c/depot/+/11884 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- tvix/castore/src/blobservice/grpc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tvix/castore/src/blobservice/grpc.rs b/tvix/castore/src/blobservice/grpc.rs index 35566f5242fd..85250da99d05 100644 --- a/tvix/castore/src/blobservice/grpc.rs +++ b/tvix/castore/src/blobservice/grpc.rs @@ -45,15 +45,15 @@ where { #[instrument(skip(self, digest), fields(blob.digest=%digest))] async fn has(&self, digest: &B3Digest) -> io::Result { - let mut grpc_client = self.grpc_client.clone(); - let resp = grpc_client + match self + .grpc_client + .clone() .stat(proto::StatBlobRequest { digest: digest.clone().into(), ..Default::default() }) - .await; - - match resp { + .await + { Ok(_blob_meta) => Ok(true), Err(e) if e.code() == Code::NotFound => Ok(false), Err(e) => Err(io::Error::new(io::ErrorKind::Other, e)), -- cgit 1.4.1