@@ -195,16 +195,17 @@ impl BackupEngine<HttpFile> for HttpFileEngine {
195195 drop ( file) ;
196196
197197 let shasum = shasum. finalize ( ) ;
198+ let shasum_hex: String = shasum. iter ( ) . map ( |b| format ! ( "{b:02x}" ) ) . collect ( ) ;
198199 if let Some ( existing_sha256) = self . get_existing_sha256 ( & target_path) . await
199- && existing_sha256 == format ! ( "{:x}" , shasum )
200+ && existing_sha256 == shasum_hex
200201 {
201202 tokio:: fs:: remove_file ( & temp_path) . await . map_err ( |e| human_errors:: wrap_user (
202203 e,
203204 format ! ( "Unable to remove temporary backup file '{}' after verifying that it is a duplicate of the existing file." , temp_path. display( ) ) ,
204205 & [ "Make sure that you have write (and delete) permission on the backup directory and try again." ] ,
205206 ) ) ?;
206207 return Ok ( BackupState :: Unchanged ( Some ( format ! (
207- "at sha256@{shasum:x }"
208+ "at sha256@{shasum_hex }"
208209 ) ) ) ) ;
209210 }
210211
@@ -217,14 +218,14 @@ impl BackupEngine<HttpFile> for HttpFileEngine {
217218 entity
218219 . last_modified
219220 . map ( |m| format ! ( "at {}" , m. format( "%Y-%m-%dT%H:%M:%S" ) ) )
220- . or ( Some ( format ! ( "at sha256:{shasum:x }" ) ) ) ,
221+ . or ( Some ( format ! ( "at sha256:{shasum_hex }" ) ) ) ,
221222 )
222223 } else {
223224 BackupState :: New (
224225 entity
225226 . last_modified
226227 . map ( |m| format ! ( "at {}" , m. format( "%Y-%m-%dT%H:%M:%S" ) ) )
227- . or ( Some ( format ! ( "at sha256:{shasum:x }" ) ) ) ,
228+ . or ( Some ( format ! ( "at sha256:{shasum_hex }" ) ) ) ,
228229 )
229230 } ;
230231
@@ -242,7 +243,7 @@ impl BackupEngine<HttpFile> for HttpFileEngine {
242243 . unwrap_or_default( )
243244 . to_string_lossy( )
244245 ) ) ,
245- format ! ( "{:x}" , shasum ) ,
246+ shasum_hex ,
246247 )
247248 . await
248249 . wrap_user_err (
0 commit comments