about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-20T15·22+0200
committerflokli <flokli@flokli.de>2024-03-20T21·02+0000
commit60b47b336b2c1bc2d39dbe5b6360cab1cea9a5eb (patch)
tree3b4a7b0266d4942b1f64d3ca777aa94fe54cf6f2
parent2350c5cbf6b21456165ff7e9d393ae530985ef20 (diff)
refactor(tvix/castore/directory): remove GRPCPutter::new r/7755
This is no public API to construct this, there's exactly one caller,
and it's perfectly fine to directly populate the struct there.

Change-Id: Idae43a0162ee9bc687d21c550e0c9df33f12d263
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11217
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
-rw-r--r--tvix/castore/src/directoryservice/grpc.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/tvix/castore/src/directoryservice/grpc.rs b/tvix/castore/src/directoryservice/grpc.rs
index ad06cb17b6..fbb9cce64e 100644
--- a/tvix/castore/src/directoryservice/grpc.rs
+++ b/tvix/castore/src/directoryservice/grpc.rs
@@ -201,7 +201,9 @@ impl DirectoryService for GRPCDirectoryService {
             Ok(s)
         });
 
-        Box::new(GRPCPutter::new(tx, task))
+        Box::new(GRPCPutter {
+            rq: Some((task, tx)),
+        })
     }
 }
 
@@ -219,15 +221,6 @@ pub struct GRPCPutter {
 }
 
 impl GRPCPutter {
-    pub fn new(
-        directory_sender: UnboundedSender<proto::Directory>,
-        task: JoinHandle<Result<proto::PutDirectoryResponse, Status>>,
-    ) -> Self {
-        Self {
-            rq: Some((task, directory_sender)),
-        }
-    }
-
     // allows checking if the tx part of the channel is closed.
     // only used in the test case.
     #[cfg(test)]