@@ -82,12 +82,12 @@ impl graph::DatabaseExt for super::MaybeOpenFsRepository {
8282#[ async_trait:: async_trait]
8383impl DatabaseView for super :: OpenFsRepository {
8484 async fn has_object ( & self , digest : encoding:: Digest ) -> bool {
85- let filepath = self . fs_impl . objects . build_digest_path ( & digest) ;
85+ let filepath = self . objects . build_digest_path ( & digest) ;
8686 tokio:: fs:: symlink_metadata ( filepath) . await . is_ok ( )
8787 }
8888
8989 async fn read_object ( & self , digest : encoding:: Digest ) -> Result < graph:: Object > {
90- let filepath = self . fs_impl . objects . build_digest_path ( & digest) ;
90+ let filepath = self . objects . build_digest_path ( & digest) ;
9191 let mut file =
9292 tokio:: io:: BufReader :: new ( tokio:: fs:: File :: open ( & filepath) . await . map_err ( |err| {
9393 match err. kind ( ) {
@@ -109,7 +109,7 @@ impl DatabaseView for super::OpenFsRepository {
109109 & self ,
110110 search_criteria : graph:: DigestSearchCriteria ,
111111 ) -> Pin < Box < dyn Stream < Item = Result < encoding:: Digest > > + Send > > {
112- Box :: pin ( self . fs_impl . objects . find ( search_criteria) )
112+ Box :: pin ( self . objects . find ( search_criteria) )
113113 }
114114
115115 fn iter_objects ( & self ) -> graph:: DatabaseIterator < ' _ > {
@@ -124,14 +124,14 @@ impl DatabaseView for super::OpenFsRepository {
124124 & self ,
125125 partial : & encoding:: PartialDigest ,
126126 ) -> Result < encoding:: Digest > {
127- self . fs_impl . objects . resolve_full_digest ( partial) . await
127+ self . objects . resolve_full_digest ( partial) . await
128128 }
129129}
130130
131131#[ async_trait:: async_trait]
132132impl graph:: Database for super :: OpenFsRepository {
133133 async fn remove_object ( & self , digest : encoding:: Digest ) -> crate :: Result < ( ) > {
134- let filepath = self . fs_impl . objects . build_digest_path ( & digest) ;
134+ let filepath = self . objects . build_digest_path ( & digest) ;
135135
136136 // this might fail but we don't consider that fatal just yet
137137 #[ cfg( unix) ]
@@ -156,7 +156,7 @@ impl graph::Database for super::OpenFsRepository {
156156 older_than : DateTime < Utc > ,
157157 digest : encoding:: Digest ,
158158 ) -> crate :: Result < bool > {
159- let filepath = self . fs_impl . objects . build_digest_path ( & digest) ;
159+ let filepath = self . objects . build_digest_path ( & digest) ;
160160
161161 // this might fail but we don't consider that fatal just yet
162162 #[ cfg( unix) ]
@@ -203,7 +203,7 @@ impl graph::Database for super::OpenFsRepository {
203203impl graph:: DatabaseExt for super :: OpenFsRepository {
204204 async fn write_object < T : ObjectProto > ( & self , obj : & graph:: FlatObject < T > ) -> Result < ( ) > {
205205 let digest = obj. digest ( ) ?;
206- let filepath = self . fs_impl . objects . build_digest_path ( & digest) ;
206+ let filepath = self . objects . build_digest_path ( & digest) ;
207207 if filepath. exists ( ) {
208208 tracing:: trace!( %digest, kind=%std:: any:: type_name:: <T >( ) , "object already exists" ) ;
209209 return Ok ( ( ) ) ;
@@ -214,8 +214,8 @@ impl graph::DatabaseExt for super::OpenFsRepository {
214214 // other processes don't try to read our incomplete
215215 // object from the database
216216 let uuid = uuid:: Uuid :: new_v4 ( ) . to_string ( ) ;
217- let working_file = self . fs_impl . objects . workdir ( ) . join ( uuid) ;
218- self . fs_impl . objects . ensure_base_dir ( & working_file) ?;
217+ let working_file = self . objects . workdir ( ) . join ( uuid) ;
218+ self . objects . ensure_base_dir ( & working_file) ?;
219219 let mut encoded = Vec :: new ( ) ;
220220 obj. encode ( & mut encoded) ?;
221221 let mut writer = tokio:: io:: BufWriter :: new (
@@ -258,7 +258,7 @@ impl graph::DatabaseExt for super::OpenFsRepository {
258258 }
259259 #[ cfg( unix) ]
260260 {
261- let perms = std:: fs:: Permissions :: from_mode ( self . fs_impl . objects . file_permissions ) ;
261+ let perms = std:: fs:: Permissions :: from_mode ( self . objects . file_permissions ) ;
262262 if let Err ( err) = tokio:: fs:: set_permissions ( & working_file, perms) . await {
263263 let _ = tokio:: fs:: remove_file ( & working_file) . await ;
264264 return Err ( Error :: StorageWriteError (
@@ -268,7 +268,7 @@ impl graph::DatabaseExt for super::OpenFsRepository {
268268 ) ) ;
269269 }
270270 }
271- self . fs_impl . objects . ensure_base_dir ( & filepath) ?;
271+ self . objects . ensure_base_dir ( & filepath) ?;
272272 match tokio:: fs:: rename ( & working_file, & filepath) . await {
273273 Ok ( _) => Ok ( ( ) ) ,
274274 Err ( err) => {
0 commit comments