about summary refs log tree commit diff
path: root/tvix/castore/src/directoryservice
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-12T13·42+0200
committerflokli <flokli@flokli.de>2023-10-14T12·26+0000
commit199e5e0339ee7d58f9e8a6958c8f9aad5b82e26d (patch)
tree9fab43f05adac8dd68420d7b9456a51f3e6d2276 /tvix/castore/src/directoryservice
parent0b18be3b57a80e8b02488cf860fdf15981f2f547 (diff)
refactor(tvix/*store): remove some grpc_client let bindings r/6800
We had to have these all while the traits where sync, and there was a
lot of spawning and moving.

Most of this can now be removed in favor of some inline `.clone()`.

Change-Id: Id5466c32a403100bc3347866b3172e06a792e311
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9705
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to 'tvix/castore/src/directoryservice')
-rw-r--r--tvix/castore/src/directoryservice/grpc.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tvix/castore/src/directoryservice/grpc.rs b/tvix/castore/src/directoryservice/grpc.rs
index 7ef9f84b0a16..4ee2d28e97c0 100644
--- a/tvix/castore/src/directoryservice/grpc.rs
+++ b/tvix/castore/src/directoryservice/grpc.rs
@@ -139,9 +139,11 @@ impl DirectoryService for GRPCDirectoryService {
     }
 
     async fn put(&self, directory: crate::proto::Directory) -> Result<B3Digest, crate::Error> {
-        let mut grpc_client = self.grpc_client.clone();
-
-        let resp = grpc_client.put(tokio_stream::iter(vec![directory])).await;
+        let resp = self
+            .grpc_client
+            .clone()
+            .put(tokio_stream::once(directory))
+            .await;
 
         match resp {
             Ok(put_directory_resp) => Ok(put_directory_resp