From 785ff80c8b8adad22927eee3a0c9c7aaa60072b3 Mon Sep 17 00:00:00 2001 From: edef Date: Sun, 19 Nov 2023 06:24:50 +0000 Subject: fix(nix-compat/nar/reader): require BufRead We rely on being able to make small reads cheaply, so this was already an implicit practical requirement. Requiring it explicitly removes a performance footgun, and makes further optimisations possible. Change-Id: I7f65880a41b1d6b5e6bf2e52dfe47d4c49b34bcd Reviewed-on: https://cl.tvl.fyi/c/depot/+/10088 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/store/src/nar/import.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/store/src') diff --git a/tvix/store/src/nar/import.rs b/tvix/store/src/nar/import.rs index a9a9cc12d8..000fc05663 100644 --- a/tvix/store/src/nar/import.rs +++ b/tvix/store/src/nar/import.rs @@ -1,5 +1,5 @@ use std::{ - io::{self, Read}, + io::{self, BufRead}, sync::Arc, }; @@ -21,7 +21,7 @@ use tvix_castore::{ /// This function is not async (because the NAR reader is not) /// and calls [tokio::task::block_in_place] when interacting with backing /// services, so make sure to only call this with spawn_blocking. -pub fn read_nar( +pub fn read_nar( r: &mut R, blob_service: Arc, directory_service: Arc, -- cgit 1.4.1