@@ -46,7 +46,7 @@ impl Repository {
46
46
)
47
47
}
48
48
49
- pub fn open_path ( dirfd : impl AsFd , path : impl AsRef < Path > ) -> Result < Repository > {
49
+ pub fn open_path ( dirfd : impl AsFd , path : impl AsRef < Path > ) -> Result < Self > {
50
50
let path = path. as_ref ( ) ;
51
51
52
52
// O_PATH isn't enough because flock()
@@ -56,17 +56,17 @@ impl Repository {
56
56
flock ( & repository, FlockOperation :: LockShared )
57
57
. context ( "Cannot lock composefs repository" ) ?;
58
58
59
- Ok ( Repository { repository } )
59
+ Ok ( Self { repository } )
60
60
}
61
61
62
- pub fn open_user ( ) -> Result < Repository > {
62
+ pub fn open_user ( ) -> Result < Self > {
63
63
let home = std:: env:: var ( "HOME" ) . with_context ( || "$HOME must be set when in user mode" ) ?;
64
64
65
- Repository :: open_path ( CWD , PathBuf :: from ( home) . join ( ".var/lib/composefs" ) )
65
+ Self :: open_path ( CWD , PathBuf :: from ( home) . join ( ".var/lib/composefs" ) )
66
66
}
67
67
68
- pub fn open_system ( ) -> Result < Repository > {
69
- Repository :: open_path ( CWD , PathBuf :: from ( "/sysroot/composefs" . to_string ( ) ) )
68
+ pub fn open_system ( ) -> Result < Self > {
69
+ Self :: open_path ( CWD , PathBuf :: from ( "/sysroot/composefs" . to_string ( ) ) )
70
70
}
71
71
72
72
fn ensure_dir ( & self , dir : impl AsRef < Path > ) -> ErrnoResult < ( ) > {
@@ -212,7 +212,7 @@ impl Repository {
212
212
} ;
213
213
let stream_path = format ! ( "streams/{}" , hex:: encode( sha256) ) ;
214
214
let object_id = writer. done ( ) ?;
215
- let object_path = Repository :: format_object_path ( & object_id) ;
215
+ let object_path = Self :: format_object_path ( & object_id) ;
216
216
self . ensure_symlink ( & stream_path, & object_path) ?;
217
217
218
218
if let Some ( name) = reference {
@@ -261,7 +261,7 @@ impl Repository {
261
261
callback ( & mut writer) ?;
262
262
let object_id = writer. done ( ) ?;
263
263
264
- let object_path = Repository :: format_object_path ( & object_id) ;
264
+ let object_path = Self :: format_object_path ( & object_id) ;
265
265
self . ensure_symlink ( & stream_path, & object_path) ?;
266
266
object_id
267
267
}
@@ -411,11 +411,11 @@ impl Repository {
411
411
let filename = entry. file_name ( ) ;
412
412
if filename != c"." && filename != c".." {
413
413
let dirfd = openat ( & fd, filename, OFlags :: RDONLY , Mode :: empty ( ) ) ?;
414
- Repository :: walk_symlinkdir ( dirfd, objects) ?;
414
+ Self :: walk_symlinkdir ( dirfd, objects) ?;
415
415
}
416
416
}
417
417
FileType :: Symlink => {
418
- objects. insert ( Repository :: read_symlink_hashvalue ( & fd, entry. file_name ( ) ) ?) ;
418
+ objects. insert ( Self :: read_symlink_hashvalue ( & fd, entry. file_name ( ) ) ?) ;
419
419
}
420
420
_ => {
421
421
bail ! ( "Unexpected file type encountered" ) ;
@@ -447,7 +447,7 @@ impl Repository {
447
447
OFlags :: RDONLY | OFlags :: DIRECTORY ,
448
448
Mode :: empty ( ) ,
449
449
) ?;
450
- Repository :: walk_symlinkdir ( refs, & mut objects) ?;
450
+ Self :: walk_symlinkdir ( refs, & mut objects) ?;
451
451
452
452
for item in Dir :: read_from ( & category_fd) ? {
453
453
let entry = item?;
0 commit comments