diff options
author | Florian Klink <flokli@flokli.de> | 2024-04-13T16·22+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-04-15T14·06+0000 |
commit | b70744fda627594cd42f8b6ae2d0dd1d7d037d61 (patch) | |
tree | e836230cb90aa6dd723d41aff2d9ee7dab66308e /tvix/glue/src/builtins | |
parent | bcc00fba8f65c767f831ab05f15278d23ea4b322 (diff) |
refactor(tvix/*/import): rename direntry_stream, entries_per_depths r/7925
Align these names and comments with the two users, to make it more obvious we're doing the same thing here, just use a different method to come up with entries_per_depths. Change-Id: I42058e397588b6b57a6299e87183bef27588b228 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11415 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to 'tvix/glue/src/builtins')
-rw-r--r-- | tvix/glue/src/builtins/import.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tvix/glue/src/builtins/import.rs b/tvix/glue/src/builtins/import.rs index 3a2dea953fd3..800f8ddc17c2 100644 --- a/tvix/glue/src/builtins/import.rs +++ b/tvix/glue/src/builtins/import.rs @@ -3,6 +3,7 @@ use crate::builtins::errors::ImportError; use futures::pin_mut; use std::path::Path; +use tvix_castore::import::leveled_entries_to_stream; use tvix_eval::{ builtin_macros::builtins, generators::{self, GenCo}, @@ -17,6 +18,7 @@ async fn filtered_ingest( path: &Path, filter: Option<&Value>, ) -> Result<tvix_castore::proto::node::Node, ErrorKind> { + // produce the leveled-key vector of DirEntry. let mut entries_per_depths: Vec<Vec<walkdir::DirEntry>> = vec![Vec::new()]; let mut it = walkdir::WalkDir::new(path) .follow_links(false) @@ -99,13 +101,12 @@ async fn filtered_ingest( // FUTUREWORK: determine when it's the right moment to flush a level to the ingester. } - let entries_stream = tvix_castore::import::leveled_entries_to_stream(entries_per_depths); - - pin_mut!(entries_stream); + let direntry_stream = leveled_entries_to_stream(entries_per_depths); + pin_mut!(direntry_stream); state.tokio_handle.block_on(async { state - .ingest_entries(entries_stream) + .ingest_entries(direntry_stream) .await .map_err(|err| ErrorKind::IO { path: Some(path.to_path_buf()), |