From 51e0f78e9317c1234bc982dcaa280c0d3674d164 Mon Sep 17 00:00:00 2001 From: edef Date: Mon, 29 Apr 2024 17:34:49 +0000 Subject: feat(nix-compat/wire/bytes/reader): support buffered reading If our underlying reader supports AsyncBufRead, then we can too. Change-Id: If4b948c983400ca591c1c475bbcf7dc00d562040 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11545 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/store/src/nar/import.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tvix/store/src/nar/import.rs') diff --git a/tvix/store/src/nar/import.rs b/tvix/store/src/nar/import.rs index cc62c1a4e902..7a9f1231e76a 100644 --- a/tvix/store/src/nar/import.rs +++ b/tvix/store/src/nar/import.rs @@ -70,8 +70,7 @@ where } => { let (digest, size) = { let mut blob_writer = blob_service.open_write().await; - // TODO(edef): fix the AsyncBufRead implementation of nix_compat::wire::BytesReader - let size = tokio::io::copy(&mut reader, &mut blob_writer).await?; + let size = tokio::io::copy_buf(&mut reader, &mut blob_writer).await?; (blob_writer.close().await?, size) }; -- cgit 1.4.1