From 40f65b363fb9826d5224cbce9d1c66cc70774735 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 27 Mar 2024 12:14:14 +0100 Subject: refactor(tvix/store/nar/renderer): don't require AsRef Previous CLs ensured BlobService and DirectoryService is implemented on AsRef and AsRef respectively, so there's no need to require AsRef in here. Change-Id: I1e8b93188ca784e1b9a592f3d35fcf6b9df75c75 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11275 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- tvix/store/src/nar/renderer.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tvix/store/src/nar/renderer.rs b/tvix/store/src/nar/renderer.rs index 313397dcf3..9ac363ff57 100644 --- a/tvix/store/src/nar/renderer.rs +++ b/tvix/store/src/nar/renderer.rs @@ -23,8 +23,8 @@ pub async fn calculate_size_and_sha256( directory_service: DS, ) -> Result<(u64, [u8; 32]), RenderError> where - BS: AsRef + Send, - DS: AsRef + Send, + BS: BlobService + Send, + DS: DirectoryService + Send, { let mut h = Sha256::new(); let mut cw = CountWrite::from(&mut h); @@ -79,8 +79,8 @@ pub async fn write_nar( ) -> Result<(), RenderError> where W: AsyncWrite + Unpin + Send, - BS: AsRef + Send, - DS: AsRef + Send, + BS: BlobService + Send, + DS: DirectoryService + Send, { // Initialize NAR writer let mut w = w.compat_write(); @@ -109,8 +109,8 @@ async fn walk_node( directory_service: DS, ) -> Result<(BS, DS), RenderError> where - BS: AsRef + Send, - DS: AsRef + Send, + BS: BlobService + Send, + DS: DirectoryService + Send, { match proto_node { castorepb::node::Node::Symlink(proto_symlink_node) => { @@ -129,7 +129,6 @@ where })?; let blob_reader = match blob_service - .as_ref() .open_read(&digest) .await .map_err(RenderError::StoreError)? @@ -165,7 +164,6 @@ where // look it up with the directory service match directory_service - .as_ref() .get(&digest) .await .map_err(|e| RenderError::StoreError(e.into()))? -- cgit 1.4.1