diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-31T21·33+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-01-01T14·45+0000 |
commit | 597a6b6205c3455ac92d816ad5e85af9615f6063 (patch) | |
tree | f9becbc2625eeadd9ac7029f4823dec6b9fb0ddf /tvix/store/src/nar/import.rs | |
parent | 09a92b78d27dbf25210169a35c30bcff0b01b2ec (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/store/src/nar/import.rs')
-rw-r--r-- | tvix/store/src/nar/import.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tvix/store/src/nar/import.rs b/tvix/store/src/nar/import.rs index 9be42aeafa0f..cda5b4e05a61 100644 --- a/tvix/store/src/nar/import.rs +++ b/tvix/store/src/nar/import.rs @@ -220,8 +220,11 @@ where mod test { use crate::nar::read_nar; use std::io::Cursor; + use std::sync::Arc; use tokio_stream::StreamExt; + use tvix_castore::blobservice::BlobService; + use tvix_castore::directoryservice::DirectoryService; use tvix_castore::fixtures::{ DIRECTORY_COMPLICATED, DIRECTORY_WITH_KEEP, EMPTY_BLOB_DIGEST, HELLOWORLD_BLOB_CONTENTS, HELLOWORLD_BLOB_DIGEST, @@ -235,8 +238,8 @@ mod test { #[tokio::test] async fn single_symlink() { - let blob_service = gen_blob_service(); - let directory_service = gen_directory_service(); + let blob_service: Arc<dyn BlobService> = gen_blob_service().into(); + let directory_service: Arc<dyn DirectoryService> = gen_directory_service().into(); let handle = tokio::runtime::Handle::current(); @@ -263,8 +266,8 @@ mod test { #[tokio::test] async fn single_file() { - let blob_service = gen_blob_service(); - let directory_service = gen_directory_service(); + let blob_service: Arc<dyn BlobService> = gen_blob_service().into(); + let directory_service: Arc<dyn DirectoryService> = gen_directory_service().into(); let handle = tokio::runtime::Handle::current(); @@ -299,8 +302,8 @@ mod test { #[tokio::test] async fn complicated() { - let blob_service = gen_blob_service(); - let directory_service = gen_directory_service(); + let blob_service: Arc<dyn BlobService> = gen_blob_service().into(); + let directory_service: Arc<dyn DirectoryService> = gen_directory_service().into(); let handle = tokio::runtime::Handle::current(); |