about summary refs log tree commit diff
path: root/tvix/castore/src/fs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-01-09T15·39+0200
committerclbot <clbot@tvl.fyi>2024-01-09T16·20+0000
commit9596c5caff78cfdd702f0267ff44b8b68f2a8a65 (patch)
treec1a70fb218e5aa1292ce0858a8f3bd54575d4850 /tvix/castore/src/fs
parent9de1ebf23ef6b34263c5ed9704c8ee173d9d875c (diff)
refactor(tvix/castore): do clone inside a scope r/7364
Make it clear this is only used inside the scope.

Change-Id: Ie94f88d7f0fb58cd4bf9c2f1176000b272e6f2e6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10585
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/castore/src/fs')
-rw-r--r--tvix/castore/src/fs/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/tvix/castore/src/fs/mod.rs b/tvix/castore/src/fs/mod.rs
index 632dad84cf86..28528f38af1d 100644
--- a/tvix/castore/src/fs/mod.rs
+++ b/tvix/castore/src/fs/mod.rs
@@ -490,12 +490,11 @@ where
                 let span = info_span!("read", blob.digest = %blob_digest);
                 let _enter = span.enter();
 
-                let blob_service = self.blob_service.clone();
-                let blob_digest = blob_digest.clone();
-
-                let task = self
-                    .tokio_handle
-                    .spawn(async move { blob_service.as_ref().open_read(&blob_digest).await });
+                let task = self.tokio_handle.spawn({
+                    let blob_service = self.blob_service.clone();
+                    let blob_digest = blob_digest.clone();
+                    async move { blob_service.as_ref().open_read(&blob_digest).await }
+                });
 
                 let blob_reader = self.tokio_handle.block_on(task).unwrap();