about summary refs log tree commit diff
path: root/tvix/store/src/tests/nar_renderer.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-09T15·22+0300
committerclbot <clbot@tvl.fyi>2023-06-12T10·24+0000
commitaa7bdc1199bfbb69091dda942a82812257e30bc4 (patch)
tree933964562f5746274ef6df59cfa956aca73b0807 /tvix/store/src/tests/nar_renderer.rs
parent7725eb53ad67730e92a3839a6c10925c668e5586 (diff)
refactor(tvix/store): use Arc instead of Box r/6273
This allows us to blob services without closing them before putting them
in a box.
We currently need to use Arc<_>, not Rc<_>, because the GRPC wrappers
require Sync.

Change-Id: I679c5f06b62304f5b0456cfefe25a0a881de7c84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8738
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/tests/nar_renderer.rs')
-rw-r--r--tvix/store/src/tests/nar_renderer.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/tvix/store/src/tests/nar_renderer.rs b/tvix/store/src/tests/nar_renderer.rs
index bc9cc635eec3..37a01c2e1826 100644
--- a/tvix/store/src/tests/nar_renderer.rs
+++ b/tvix/store/src/tests/nar_renderer.rs
@@ -19,8 +19,8 @@ fn single_symlink() {
             target: "/nix/store/somewhereelse".to_string(),
         }),
         // don't put anything in the stores, as we don't actually do any requests.
-        &gen_blob_service(),
-        &gen_directory_service(),
+        gen_blob_service(),
+        gen_directory_service(),
     )
     .expect("must succeed");
 
@@ -41,8 +41,8 @@ fn single_file_missing_blob() {
             executable: false,
         }),
         // the blobservice is empty intentionally, to provoke the error.
-        &gen_blob_service(),
-        &gen_directory_service(),
+        gen_blob_service(),
+        gen_directory_service(),
     )
     .expect_err("must fail");
 
@@ -81,8 +81,8 @@ fn single_file_wrong_blob_size() {
                 size: 42, // <- note the wrong size here!
                 executable: false,
             }),
-            &blob_service,
-            &gen_directory_service(),
+            blob_service.clone(),
+            gen_directory_service(),
         )
         .expect_err("must fail");
 
@@ -106,8 +106,8 @@ fn single_file_wrong_blob_size() {
                 size: 2, // <- note the wrong size here!
                 executable: false,
             }),
-            &blob_service,
-            &gen_directory_service(),
+            blob_service,
+            gen_directory_service(),
         )
         .expect_err("must fail");
 
@@ -143,8 +143,8 @@ fn single_file() {
             size: HELLOWORLD_BLOB_CONTENTS.len() as u32,
             executable: false,
         }),
-        &blob_service,
-        &gen_directory_service(),
+        blob_service,
+        gen_directory_service(),
     )
     .expect("must succeed");
 
@@ -180,8 +180,8 @@ fn test_complicated() {
             digest: DIRECTORY_COMPLICATED.digest().to_vec(),
             size: DIRECTORY_COMPLICATED.size(),
         }),
-        &blob_service,
-        &directory_service,
+        blob_service.clone(),
+        directory_service.clone(),
     )
     .expect("must succeed");
 
@@ -194,8 +194,8 @@ fn test_complicated() {
             digest: DIRECTORY_COMPLICATED.digest().to_vec(),
             size: DIRECTORY_COMPLICATED.size(),
         }),
-        &blob_service,
-        &directory_service,
+        blob_service,
+        directory_service,
     )
     .expect("must succeed");