about summary refs log tree commit diff
path: root/tvix/castore/src/utils.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-31T21·33+0200
committerflokli <flokli@flokli.de>2024-01-01T14·45+0000
commit597a6b6205c3455ac92d816ad5e85af9615f6063 (patch)
treef9becbc2625eeadd9ac7029f4823dec6b9fb0ddf /tvix/castore/src/utils.rs
parent09a92b78d27dbf25210169a35c30bcff0b01b2ec (diff)
refactor(tvix/castore/tests): let gen_*_service return Boxes r/7307
Only convert to and reuse an Arc<…> where needed.

Change-Id: I2c1bc69cca5a4a3ebd3bdb33d6e28e1f5fb86cb9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10514
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/castore/src/utils.rs')
-rw-r--r--tvix/castore/src/utils.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/tvix/castore/src/utils.rs b/tvix/castore/src/utils.rs
index d9a7254a5651..ca68f9f26c5a 100644
--- a/tvix/castore/src/utils.rs
+++ b/tvix/castore/src/utils.rs
@@ -1,8 +1,6 @@
 //! A crate containing constructors to provide instances of a BlobService and
 //! DirectoryService. Only used for testing purposes, but across crates.
 //! Should be removed once we have a better concept of a "Service registry".
-use std::sync::Arc;
-
 use tonic::transport::{Channel, Endpoint, Server, Uri};
 
 use crate::{
@@ -16,12 +14,12 @@ use crate::{
     },
 };
 
-pub fn gen_blob_service() -> Arc<dyn BlobService> {
-    Arc::new(MemoryBlobService::default())
+pub fn gen_blob_service() -> Box<dyn BlobService> {
+    Box::<MemoryBlobService>::default()
 }
 
-pub fn gen_directory_service() -> Arc<dyn DirectoryService> {
-    Arc::new(MemoryDirectoryService::default())
+pub fn gen_directory_service() -> Box<dyn DirectoryService> {
+    Box::<MemoryDirectoryService>::default()
 }
 
 /// This will spawn the a gRPC server with a DirectoryService client, connect a