about summary refs log tree commit diff
path: root/tvix/store/src/fuse/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-11T19·08+0300
committerflokli <flokli@flokli.de>2023-06-12T10·28+0000
commit09c5ca0a0d50c87a4404dba97737def573817a9b (patch)
tree407cf3455a95a9ba198efdd2ed59f9fc19c6dfbe /tvix/store/src/fuse/mod.rs
parent38a7caaada826ebdbc9db3a9042ab1bf2099472b (diff)
refactor(tvix/store/fuse): use Arc<dyn …> instead of generics r/6275
Change-Id: I5685379bd6f89d17da6843d31bef4c1fc4dc0a18
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8745
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/fuse/mod.rs')
-rw-r--r--tvix/store/src/fuse/mod.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/tvix/store/src/fuse/mod.rs b/tvix/store/src/fuse/mod.rs
index a93f482ebff6..d28e2b309c43 100644
--- a/tvix/store/src/fuse/mod.rs
+++ b/tvix/store/src/fuse/mod.rs
@@ -1,24 +1,26 @@
 use crate::{
     blobservice::BlobService, directoryservice::DirectoryService, pathinfoservice::PathInfoService,
 };
+use std::sync::Arc;
 
-pub struct FUSE<BS: BlobService, DS: DirectoryService, PS: PathInfoService> {
-    blob_service: BS,
-    directory_service: DS,
+pub struct FUSE<PS: PathInfoService> {
+    blob_service: Arc<dyn BlobService>,
+    directory_service: Arc<dyn DirectoryService>,
     path_info_service: PS,
 }
 
-impl<BS: BlobService, DS: DirectoryService, PS: PathInfoService> FUSE<BS, DS, PS> {
-    pub fn new(path_info_service: PS, directory_service: DS, blob_service: BS) -> Self {
+impl<PS: PathInfoService> FUSE<PS> {
+    pub fn new(
+        blob_service: Arc<dyn BlobService>,
+        directory_service: Arc<dyn DirectoryService>,
+        path_info_service: PS,
+    ) -> Self {
         Self {
             blob_service,
-            path_info_service,
             directory_service,
+            path_info_service,
         }
     }
 }
 
-impl<BS: BlobService, DS: DirectoryService, PS: PathInfoService> fuser::Filesystem
-    for FUSE<BS, DS, PS>
-{
-}
+impl<PS: PathInfoService> fuser::Filesystem for FUSE<PS> {}