refactor(tvix/castore): don't require Arc'd DirectoryService
Since cl/12661 this doesn't need to be Arc'd. Change-Id: I3c14c45df7815867ddea6f461e81649772648962 Reviewed-on: https://cl.tvl.fyi/c/depot/+/13155 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
dc5c3f7b40
commit
22854c75f3
1 changed files with 6 additions and 11 deletions
|
|
@ -10,7 +10,7 @@ pub async fn descend_to<DS>(
|
|||
path: impl AsRef<Path> + std::fmt::Display,
|
||||
) -> Result<Option<Node>, Error>
|
||||
where
|
||||
DS: AsRef<dyn DirectoryService>,
|
||||
DS: DirectoryService,
|
||||
{
|
||||
let mut parent_node = root_node;
|
||||
for component in path.as_ref().components_bytes() {
|
||||
|
|
@ -22,17 +22,12 @@ where
|
|||
}
|
||||
Node::Directory { digest, .. } => {
|
||||
// fetch the linked node from the directory_service.
|
||||
let directory =
|
||||
directory_service
|
||||
.as_ref()
|
||||
.get(&digest)
|
||||
.await?
|
||||
.ok_or_else(|| {
|
||||
// If we didn't get the directory node that's linked, that's a store inconsistency, bail out!
|
||||
warn!("directory {} does not exist", digest);
|
||||
let directory = directory_service.get(&digest).await?.ok_or_else(|| {
|
||||
// If we didn't get the directory node that's linked, that's a store inconsistency, bail out!
|
||||
warn!("directory {} does not exist", digest);
|
||||
|
||||
Error::StorageError(format!("directory {} does not exist", digest))
|
||||
})?;
|
||||
Error::StorageError(format!("directory {} does not exist", digest))
|
||||
})?;
|
||||
|
||||
// look for the component in the [Directory].
|
||||
if let Some((_child_name, child_node)) = directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue