refactor(tvix/castore): relax trait bounds for DS

Make this an `AsRef<dyn DirectoryService>`.

This helps dropping some Clone requirements.

Unfortunately, we can't thread this through to TvixStoreIO just yet.

Change-Id: I3f07eb28d6c793d3313fe21506ada84d5a8aa3ac
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10533
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
Florian Klink 2024-01-04 19:18:06 +02:00 committed by clbot
parent 3297843bf1
commit f20969de9b
3 changed files with 11 additions and 9 deletions

View file

@ -54,7 +54,7 @@ pub async fn import_path<BS, DS, PS, P>(
where
P: AsRef<Path> + std::fmt::Debug,
BS: Deref<Target = dyn BlobService> + Clone,
DS: Deref<Target = dyn DirectoryService> + Clone,
DS: Deref<Target = dyn DirectoryService>,
PS: Deref<Target = dyn PathInfoService>,
{
// calculate the name
@ -71,9 +71,10 @@ where
})?;
// Ingest the path into blob and directory service.
let root_node = tvix_castore::import::ingest_path(blob_service, directory_service, &path)
.await
.expect("failed to ingest path");
let root_node =
tvix_castore::import::ingest_path(blob_service, &directory_service.deref(), &path)
.await
.expect("failed to ingest path");
debug!(root_node =?root_node, "import successful");