From 011fbe221498fda8a5b23ce7ea0b3331f0d0cb64 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 12 Jun 2023 23:49:22 +0300 Subject: chore(tvix/store/directorysvc): remove GRPCDirectoryService::new 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 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/store/src/directoryservice/grpc.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'tvix/store/src') diff --git a/tvix/store/src/directoryservice/grpc.rs b/tvix/store/src/directoryservice/grpc.rs index 3b1a7906f7..913dd5bad9 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, - ) -> Self { - Self { - tokio_handle, - grpc_client, - } - } - /// construct a [GRPCDirectoryService] from a [proto::blob_service_client::BlobServiceClient]. /// 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!( -- cgit 1.4.1