about summary refs log tree commit diff
path: root/tvix/tools/crunch-v2
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2024-05-08T07·13+0000
committeredef <edef@edef.eu>2024-05-08T15·30+0000
commit31d73cd443311c5ef4bfbd8c2b66e3b9691340ec (patch)
tree906c13131daf87bcc726db9453c8226d68a3728b /tvix/tools/crunch-v2
parent17a7dac94f29d8151ecebfbf11d5b83cf0c4f415 (diff)
refactor(nix-compat/nar/reader): reuse prev_name allocation r/8095
We reuse the prev_name allocation for Entry, instead of allocating and
returning a separate Vec.

We encode the `prev_name: None` case as an empty vector, since we don't
allow empty names anyway, and the sorting is equivalent.

Change-Id: I975b37ff873805f5ff099bc82128706891052247
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11607
Reviewed-by: Brian Olsen <me@griff.name>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/tools/crunch-v2')
-rw-r--r--tvix/tools/crunch-v2/src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/tools/crunch-v2/src/main.rs b/tvix/tools/crunch-v2/src/main.rs
index a5d538f6beac..5be8c28e293f 100644
--- a/tvix/tools/crunch-v2/src/main.rs
+++ b/tvix/tools/crunch-v2/src/main.rs
@@ -147,7 +147,7 @@ fn ingest(node: nar::Node, name: Vec<u8>, avg_chunk_size: u32) -> Result<proto::
             let mut symlinks = vec![];
 
             while let Some(node) = reader.next()? {
-                match ingest(node.node, node.name, avg_chunk_size)? {
+                match ingest(node.node, node.name.to_owned(), avg_chunk_size)? {
                     proto::path::Node::Directory(node) => {
                         directories.push(node);
                     }