refactor(tvix/castore/import): rename ingest_entries arg

This is not a stream of direntries anymore, but a stream of ingestion
entries.

Change-Id: I387f4497b6567066b24c58ca0262e710348180e9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11485
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-04-20 15:00:43 +03:00 committed by clbot
parent 259d7a3cfa
commit c4cb099823

View file

@ -214,7 +214,7 @@ where
ingest_entries(directory_service, entry_stream).await
}
/// Ingests elements from the given stream of [DirEntry] into a the passed [DirectoryService].
/// Ingests elements from the given stream of [IngestionEntry] into a the passed [DirectoryService].
///
/// The stream must have the following invariants:
/// - All children entries must come before their parents.
@ -227,10 +227,7 @@ where
///
/// On success, returns the root node.
#[instrument(skip_all, ret(level = Level::TRACE), err)]
pub async fn ingest_entries<'a, DS, S>(
directory_service: DS,
#[allow(unused_mut)] mut direntry_stream: S,
) -> Result<Node, Error>
pub async fn ingest_entries<'a, DS, S>(directory_service: DS, mut entries: S) -> Result<Node, Error>
where
DS: AsRef<dyn DirectoryService>,
S: Stream<Item = Result<IngestionEntry<'a>, Error>> + Send + std::marker::Unpin,
@ -240,7 +237,7 @@ where
let mut maybe_directory_putter: Option<Box<dyn DirectoryPutter>> = None;
let root_node = loop {
let mut entry = direntry_stream
let mut entry = entries
.next()
.await
// The last entry of the stream must have 1 path component, after which