about summary refs log tree commit diff
path: root/tvix/store/src/nar/import.rs
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2024-04-29T17·34+0000
committeredef <edef@edef.eu>2024-05-08T06·03+0000
commit51e0f78e9317c1234bc982dcaa280c0d3674d164 (patch)
tree057023b4f0aa6545a757f69da0978d5028618590 /tvix/store/src/nar/import.rs
parentebad318ab3accf34dff84a49d18b96a7efd15c22 (diff)
feat(nix-compat/wire/bytes/reader): support buffered reading r/8086
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 <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/nar/import.rs')
-rw-r--r--tvix/store/src/nar/import.rs3
1 files changed, 1 insertions, 2 deletions
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)
             };