4
4
5
5
use {
6
6
crate :: release:: {
7
- bootstrap_llvm, produce_install_only, produce_install_only_stripped, RELEASE_TRIPLES ,
7
+ RELEASE_TRIPLES , bootstrap_llvm, produce_install_only, produce_install_only_stripped,
8
8
} ,
9
- anyhow:: { anyhow , Result } ,
9
+ anyhow:: { Result , anyhow } ,
10
10
bytes:: Bytes ,
11
11
clap:: ArgMatches ,
12
12
futures:: StreamExt ,
13
13
octocrab:: {
14
+ Octocrab , OctocrabBuilder ,
14
15
models:: { repos:: Release , workflows:: WorkflowListArtifact } ,
15
16
params:: actions:: ArchiveFormat ,
16
- Octocrab , OctocrabBuilder ,
17
17
} ,
18
18
rayon:: prelude:: * ,
19
19
reqwest:: { Client , StatusCode } ,
20
20
reqwest_retry:: {
21
- default_on_request_failure , policies :: ExponentialBackoff , RetryPolicy , Retryable ,
22
- RetryableStrategy ,
21
+ RetryPolicy , Retryable , RetryableStrategy , default_on_request_failure ,
22
+ policies :: ExponentialBackoff ,
23
23
} ,
24
24
sha2:: { Digest , Sha256 } ,
25
25
std:: {
@@ -70,6 +70,7 @@ enum UploadSource {
70
70
Data ( Bytes ) ,
71
71
}
72
72
73
+ #[ allow( clippy:: too_many_arguments) ]
73
74
async fn upload_release_artifact (
74
75
client : & Client ,
75
76
retry_policy : & impl RetryPolicy ,
@@ -286,16 +287,13 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
286
287
let parts = name. split ( '-' ) . collect :: < Vec < _ > > ( ) ;
287
288
288
289
if parts[ 0 ] != "cpython" {
289
- println ! ( "ignoring {} not a cpython artifact" , name ) ;
290
+ println ! ( "ignoring {name } not a cpython artifact" ) ;
290
291
continue ;
291
292
} ;
292
293
293
294
let python_version = pep440_rs:: Version :: from_str ( parts[ 1 ] ) ?;
294
295
if !release_version_range. contains ( & python_version) {
295
- println ! (
296
- "{} not in release version range {}" ,
297
- name, release_version_range
298
- ) ;
296
+ println ! ( "{name} not in release version range {release_version_range}" ) ;
299
297
continue ;
300
298
}
301
299
@@ -310,17 +308,14 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
310
308
}
311
309
} )
312
310
else {
313
- println ! (
314
- "ignoring {} does not match any registered release triples" ,
315
- name
316
- ) ;
311
+ println ! ( "ignoring {name} does not match any registered release triples" ) ;
317
312
continue ;
318
313
} ;
319
314
320
315
let stripped_name = if let Some ( s) = name. strip_suffix ( ".tar.zst" ) {
321
316
s
322
317
} else {
323
- println ! ( "ignoring {} not a .tar.zst artifact" , name ) ;
318
+ println ! ( "ignoring {name } not a .tar.zst artifact" ) ;
324
319
continue ;
325
320
} ;
326
321
@@ -333,7 +328,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
333
328
let build_suffix = & stripped_name[ triple_start + triple. len ( ) + 1 ..] ;
334
329
335
330
if !release. suffixes ( None ) . any ( |suffix| build_suffix == suffix) {
336
- println ! ( "ignoring {} not a release artifact for triple" , name ) ;
331
+ println ! ( "ignoring {name } not a release artifact for triple" ) ;
337
332
continue ;
338
333
}
339
334
@@ -342,7 +337,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
342
337
zf. read_to_end ( & mut buf) ?;
343
338
std:: fs:: write ( & dest_path, & buf) ?;
344
339
345
- println ! ( "prepared {} for release" , name ) ;
340
+ println ! ( "prepared {name } for release" ) ;
346
341
347
342
if build_suffix == release. install_only_suffix {
348
343
install_paths. push ( dest_path) ;
@@ -452,34 +447,19 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
452
447
453
448
for suffix in release. suffixes ( Some ( & python_version) ) {
454
449
wanted_filenames. insert (
455
- format ! (
456
- "cpython-{}-{}-{}-{}.tar.zst" ,
457
- version, triple, suffix, datetime
458
- ) ,
459
- format ! (
460
- "cpython-{}+{}-{}-{}-full.tar.zst" ,
461
- version, tag, triple, suffix
462
- ) ,
450
+ format ! ( "cpython-{version}-{triple}-{suffix}-{datetime}.tar.zst" ) ,
451
+ format ! ( "cpython-{version}+{tag}-{triple}-{suffix}-full.tar.zst" ) ,
463
452
) ;
464
453
}
465
454
466
455
wanted_filenames. insert (
467
- format ! (
468
- "cpython-{}-{}-install_only-{}.tar.gz" ,
469
- version, triple, datetime
470
- ) ,
471
- format ! ( "cpython-{}+{}-{}-install_only.tar.gz" , version, tag, triple) ,
456
+ format ! ( "cpython-{version}-{triple}-install_only-{datetime}.tar.gz" ) ,
457
+ format ! ( "cpython-{version}+{tag}-{triple}-install_only.tar.gz" ) ,
472
458
) ;
473
459
474
460
wanted_filenames. insert (
475
- format ! (
476
- "cpython-{}-{}-install_only_stripped-{}.tar.gz" ,
477
- version, triple, datetime
478
- ) ,
479
- format ! (
480
- "cpython-{}+{}-{}-install_only_stripped.tar.gz" ,
481
- version, tag, triple
482
- ) ,
461
+ format ! ( "cpython-{version}-{triple}-install_only_stripped-{datetime}.tar.gz" ) ,
462
+ format ! ( "cpython-{version}+{tag}-{triple}-install_only_stripped.tar.gz" ) ,
483
463
) ;
484
464
}
485
465
}
@@ -490,7 +470,7 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
490
470
. collect :: < Vec < _ > > ( ) ;
491
471
492
472
for f in & missing {
493
- println ! ( "missing release artifact: {}" , f ) ;
473
+ println ! ( "missing release artifact: {f}" ) ;
494
474
}
495
475
if missing. is_empty ( ) {
496
476
println ! ( "found all {} release artifacts" , wanted_filenames. len( ) ) ;
@@ -564,7 +544,7 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
564
544
565
545
let shasums = digests
566
546
. iter ( )
567
- . map ( |( filename, digest) | format ! ( "{} {}\n " , digest , filename ) )
547
+ . map ( |( filename, digest) | format ! ( "{digest } {filename }\n " ) )
568
548
. collect :: < Vec < _ > > ( )
569
549
. join ( "" ) ;
570
550
0 commit comments