about summary refs log tree commit diff
path: root/tvix/store/src/nar/renderer.rs
diff options
context:
space:
mode:
authorConnor Brewster <cbrewster@hey.com>2024-05-06T15·53-0500
committerclbot <clbot@tvl.fyi>2024-05-06T16·05+0000
commitda9bc274f3a07a461b279b18c6b650b0a2808c39 (patch)
treeec027f4e2b643ff0a95014b57f29327826291092 /tvix/store/src/nar/renderer.rs
parent01a4a2399c2455b672051c1a005dabaf2971025d (diff)
refactor(tvix): remove usage of async-recursion r/8082
Rust 1.77 supports async recursion as long as there is some form of
indirection (ie. `Box::pin`). This removes the need to use the
async-recursion crate.

Change-Id: Ic9613ab7f32016f0103032a861edff92e2fb8b41
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11596
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/store/src/nar/renderer.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/tvix/store/src/nar/renderer.rs b/tvix/store/src/nar/renderer.rs
index 0816b8e973..3b39f700bd 100644
--- a/tvix/store/src/nar/renderer.rs
+++ b/tvix/store/src/nar/renderer.rs
@@ -1,7 +1,6 @@
 use crate::utils::AsyncIoBridge;
 
 use super::RenderError;
-use async_recursion::async_recursion;
 use count_write::CountWrite;
 use nix_compat::nar::writer::r#async as nar_writer;
 use sha2::{Digest, Sha256};
@@ -72,9 +71,8 @@ where
 
 /// Process an intermediate node in the structure.
 /// This consumes the node.
-#[async_recursion]
 async fn walk_node<BS, DS>(
-    nar_node: nar_writer::Node<'async_recursion, '_>,
+    nar_node: nar_writer::Node<'_, '_>,
     proto_node: &castorepb::node::Node,
     blob_service: BS,
     directory_service: DS,
@@ -164,9 +162,13 @@ where
                             .await
                             .map_err(RenderError::NARWriterError)?;
 
-                        (blob_service, directory_service) =
-                            walk_node(child_node, &proto_node, blob_service, directory_service)
-                                .await?;
+                        (blob_service, directory_service) = Box::pin(walk_node(
+                            child_node,
+                            &proto_node,
+                            blob_service,
+                            directory_service,
+                        ))
+                        .await?;
                     }
 
                     // close the directory