about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-12T20·49+0300
committerclbot <clbot@tvl.fyi>2023-06-12T21·33+0000
commit011fbe221498fda8a5b23ce7ea0b3331f0d0cb64 (patch)
treed5131693544d9d51ff2dbc8b4e68426597dc0558 /tvix/store/src
parent37e7742ba91991551cc81a0c9280247da8bf7656 (diff)
chore(tvix/store/directorysvc): remove GRPCDirectoryService::new r/6281
The only place where we did use new was also already where we've been in
a tokio context, so just using from_client is easier.

Change-Id: I39dbc18f6aaa3abc342409be623395647f968530
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8754
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/directoryservice/grpc.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/tvix/store/src/directoryservice/grpc.rs b/tvix/store/src/directoryservice/grpc.rs
index 3b1a7906f7d0..913dd5bad93f 100644
--- a/tvix/store/src/directoryservice/grpc.rs
+++ b/tvix/store/src/directoryservice/grpc.rs
@@ -21,18 +21,6 @@ pub struct GRPCDirectoryService {
 }
 
 impl GRPCDirectoryService {
-    /// Construct a new [GRPCDirectoryService], by passing a handle to the
-    /// tokio runtime, and a gRPC client.
-    pub fn new(
-        tokio_handle: tokio::runtime::Handle,
-        grpc_client: proto::directory_service_client::DirectoryServiceClient<Channel>,
-    ) -> Self {
-        Self {
-            tokio_handle,
-            grpc_client,
-        }
-    }
-
     /// construct a [GRPCDirectoryService] from a [proto::blob_service_client::BlobServiceClient<Channel>].
     /// panics if called outside the context of a tokio runtime.
     pub fn from_client(
@@ -413,8 +401,7 @@ mod tests {
             let grpc_client = proto::directory_service_client::DirectoryServiceClient::new(channel);
 
             // create the GrpcDirectoryService, using the tester_runtime.
-            let directory_service =
-                super::GRPCDirectoryService::new(tokio::runtime::Handle::current(), grpc_client);
+            let directory_service = super::GRPCDirectoryService::from_client(grpc_client);
 
             // try to get DIRECTORY_A should return Ok(None)
             assert_eq!(