diff options
author | Florian Klink <flokli@flokli.de> | 2024-10-18T12·41+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-10-18T21·45+0000 |
commit | 9c223450199b466c535f2b715ad68f1f295fa7dc (patch) | |
tree | 18834efec0cefeb1a6362095e6b2b4e7e094cfe1 /tvix/store/src/pathinfoservice/fs/mod.rs | |
parent | 47efebfc6fcbce028c0f3df5f9d584119e8e8ffe (diff) |
refactor(tvix/[ca]store): use auto_impl r/8835
This implements BS, DS, PS for Box'ed or Arc'ed variants of it with less code, and less potential to accidentially forget to proxy default trait methods for blanked impls, as fixed in cl/12658. Change-Id: If2cdbb563a73792038ebe7bff45d6f880214855b Reviewed-on: https://cl.tvl.fyi/c/depot/+/12661 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu>
Diffstat (limited to 'tvix/store/src/pathinfoservice/fs/mod.rs')
-rw-r--r-- | tvix/store/src/pathinfoservice/fs/mod.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tvix/store/src/pathinfoservice/fs/mod.rs b/tvix/store/src/pathinfoservice/fs/mod.rs index d996ec9f6f76..ea30a2f6477c 100644 --- a/tvix/store/src/pathinfoservice/fs/mod.rs +++ b/tvix/store/src/pathinfoservice/fs/mod.rs @@ -20,9 +20,9 @@ pub fn make_fs<BS, DS, PS>( show_xattr: bool, ) -> TvixStoreFs<BS, DS, RootNodesWrapper<PS>> where - BS: AsRef<dyn BlobService> + Send + Clone + 'static, - DS: AsRef<dyn DirectoryService> + Send + Clone + 'static, - PS: AsRef<dyn PathInfoService> + Send + Sync + Clone + 'static, + BS: BlobService + Send + Clone + 'static, + DS: DirectoryService + Send + Clone + 'static, + PS: PathInfoService + Send + Sync + Clone + 'static, { TvixStoreFs::new( blob_service, @@ -46,7 +46,7 @@ pub struct RootNodesWrapper<T>(pub(crate) T); #[async_trait] impl<T> RootNodes for RootNodesWrapper<T> where - T: AsRef<dyn PathInfoService> + Send + Sync, + T: PathInfoService + Send + Sync, { async fn get_by_basename(&self, name: &PathComponent) -> Result<Option<Node>, Error> { let Ok(store_path) = StorePathRef::from_bytes(name.as_ref()) else { @@ -55,14 +55,13 @@ where Ok(self .0 - .as_ref() .get(*store_path.digest()) .await? .map(|path_info| path_info.node)) } fn list(&self) -> BoxStream<Result<(PathComponent, Node), Error>> { - Box::pin(self.0.as_ref().list().map(|result| { + Box::pin(self.0.list().map(|result| { result.map(|path_info| { let basename = path_info.store_path.to_string(); ( |