@@ -395,11 +395,9 @@ fn download(cache_dir: &Path, url: &str) -> Result<PathBuf, Box<dyn StdError>> {
395
395
}
396
396
397
397
if !file_path. exists ( ) {
398
- return Err ( format ! (
399
- "Downloaded file was not written to the expected location: {}" ,
400
- url
401
- )
402
- . into ( ) ) ;
398
+ return Err (
399
+ format ! ( "Downloaded file was not written to the expected location: {url}" , ) . into ( ) ,
400
+ ) ;
403
401
}
404
402
Ok ( file_path)
405
403
}
@@ -425,14 +423,11 @@ fn verify_signature_file(cache_dir: &Path, signature_path: &Path) -> Result<(),
425
423
426
424
if !output. status . success ( ) {
427
425
eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
428
- return Err ( Box :: new ( std:: io:: Error :: new (
429
- std:: io:: ErrorKind :: Other ,
430
- format ! (
431
- "Command: {:?} \n GPG signature file verification failed for signature: {}" ,
432
- cmd,
433
- signature_path. display( )
434
- ) ,
435
- ) ) ) ;
426
+ return Err ( Box :: new ( std:: io:: Error :: other ( format ! (
427
+ "Command: {:?} \n GPG signature file verification failed for signature: {}" ,
428
+ cmd,
429
+ signature_path. display( )
430
+ ) ) ) ) ;
436
431
}
437
432
} else {
438
433
println ! ( "GPG not found, skipping signature file verification" ) ;
@@ -460,14 +455,11 @@ fn verify_archive_signature(
460
455
let output = cmd. stderr_to_stdout ( ) . stdout_capture ( ) . unchecked ( ) . run ( ) ?;
461
456
if !output. status . success ( ) {
462
457
eprintln ! ( "{}" , String :: from_utf8_lossy( & output. stdout) ) ;
463
- return Err ( Box :: new ( std:: io:: Error :: new (
464
- std:: io:: ErrorKind :: Other ,
465
- format ! (
466
- "Command: {:?}\n GPG signature verification failed of archive failed [{}]" ,
467
- cmd,
468
- archive_path. display( )
469
- ) ,
470
- ) ) ) ;
458
+ return Err ( Box :: new ( std:: io:: Error :: other ( format ! (
459
+ "Command: {:?}\n GPG signature verification failed of archive failed [{}]" ,
460
+ cmd,
461
+ archive_path. display( )
462
+ ) ) ) ) ;
471
463
}
472
464
} else {
473
465
println ! ( "GPG not found, skipping signature verification" ) ;
0 commit comments