@@ -96,7 +96,7 @@ impl Snapshotter for CompressedArchiveSnapshotter {
96
96
let archive_path = self . ongoing_snapshot_directory . join ( archive_name) ;
97
97
let filesize = self . create_and_verify_archive ( & archive_path) . inspect_err ( |_err| {
98
98
if archive_path. exists ( ) {
99
- if let Err ( remove_error) = std :: fs:: remove_file ( & archive_path) {
99
+ if let Err ( remove_error) = fs:: remove_file ( & archive_path) {
100
100
warn ! (
101
101
" > Post snapshotter.snapshot failure, could not remove temporary archive at path: path:{}, err: {}" ,
102
102
archive_path. display( ) ,
@@ -121,15 +121,15 @@ impl CompressedArchiveSnapshotter {
121
121
compression_algorithm : SnapshotterCompressionAlgorithm ,
122
122
) -> StdResult < CompressedArchiveSnapshotter > {
123
123
if ongoing_snapshot_directory. exists ( ) {
124
- std :: fs:: remove_dir_all ( & ongoing_snapshot_directory) . with_context ( || {
124
+ fs:: remove_dir_all ( & ongoing_snapshot_directory) . with_context ( || {
125
125
format ! (
126
126
"Can not remove snapshotter directory: '{}'." ,
127
127
ongoing_snapshot_directory. display( )
128
128
)
129
129
} ) ?;
130
130
}
131
131
132
- std :: fs:: create_dir ( & ongoing_snapshot_directory) . map_err ( |e| {
132
+ fs:: create_dir ( & ongoing_snapshot_directory) . map_err ( |e| {
133
133
DependenciesBuilderError :: Initialization {
134
134
message : format ! (
135
135
"Can not create snapshotter directory: '{}'." ,
@@ -147,7 +147,7 @@ impl CompressedArchiveSnapshotter {
147
147
}
148
148
149
149
fn get_file_size ( filepath : & Path ) -> StdResult < u64 > {
150
- let res = std :: fs:: metadata ( filepath)
150
+ let res = fs:: metadata ( filepath)
151
151
. map_err ( |e| SnapshotError :: GeneralError ( e. to_string ( ) ) ) ?
152
152
. len ( ) ;
153
153
Ok ( res)
@@ -454,12 +454,7 @@ mod tests {
454
454
. unwrap ( ) ,
455
455
) ;
456
456
457
- assert_eq ! (
458
- 0 ,
459
- std:: fs:: read_dir( pending_snapshot_directory)
460
- . unwrap( )
461
- . count( )
462
- ) ;
457
+ assert_eq ! ( 0 , fs:: read_dir( pending_snapshot_directory) . unwrap( ) . count( ) ) ;
463
458
}
464
459
465
460
#[ test]
@@ -485,7 +480,7 @@ mod tests {
485
480
let _ = snapshotter
486
481
. snapshot ( "whatever.tar.gz" )
487
482
. expect_err ( "Snapshotter::snapshot should fail if the db is empty." ) ;
488
- let remaining_files: Vec < String > = std :: fs:: read_dir ( & pending_snapshot_directory)
483
+ let remaining_files: Vec < String > = fs:: read_dir ( & pending_snapshot_directory)
489
484
. unwrap ( )
490
485
. map ( |f| f. unwrap ( ) . file_name ( ) . to_str ( ) . unwrap ( ) . to_owned ( ) )
491
486
. collect ( ) ;
0 commit comments