diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-18T08·20+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-18T14·10+0000 |
commit | 9c1358fe44d368904b2cf75e308444dffefdb3eb (patch) | |
tree | 639177f8d0e6d150f90a58c66ba21e6451e15e7a /tvix/store | |
parent | 0ae32d45f690eed8f259ac55b4d0d8bbc006baf2 (diff) |
refactor(tvix/store): remove more clones on pathinfoservice r/7229
These are still leftovers from before the traits being async, where we had to clone before moving into an async closure. Change-Id: I1b3937edf61ce3e23bb07803306622c37a3572c6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10381 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store')
-rw-r--r-- | tvix/store/src/proto/grpc_pathinfoservice_wrapper.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tvix/store/src/proto/grpc_pathinfoservice_wrapper.rs b/tvix/store/src/proto/grpc_pathinfoservice_wrapper.rs index 7632614291dc..06c4b2f1fd0a 100644 --- a/tvix/store/src/proto/grpc_pathinfoservice_wrapper.rs +++ b/tvix/store/src/proto/grpc_pathinfoservice_wrapper.rs @@ -73,8 +73,8 @@ impl proto::path_info_service_server::PathInfoService for GRPCPathInfoServiceWra match request.into_inner().node { None => Err(Status::invalid_argument("no root node sent")), Some(root_node) => { - let path_info_service = self.path_info_service.clone(); - let (nar_size, nar_sha256) = path_info_service + let (nar_size, nar_sha256) = self + .path_info_service .calculate_nar(&root_node) .await .expect("error during nar calculation"); // TODO: handle error @@ -94,10 +94,9 @@ impl proto::path_info_service_server::PathInfoService for GRPCPathInfoServiceWra ) -> Result<Response<Self::ListStream>, Status> { let (tx, rx) = tokio::sync::mpsc::channel(5); - let path_info_service = self.path_info_service.clone(); + let mut stream = self.path_info_service.list(); let _task = task::spawn(async move { - let mut stream = path_info_service.list(); while let Some(e) = stream.next().await { let res = e.map_err(|e| Status::internal(e.to_string())); if tx.send(res).await.is_err() { |