44
55use {
66 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,
88 } ,
9- anyhow:: { anyhow , Result } ,
9+ anyhow:: { Result , anyhow } ,
1010 bytes:: Bytes ,
1111 clap:: ArgMatches ,
1212 futures:: StreamExt ,
1313 octocrab:: {
14+ Octocrab , OctocrabBuilder ,
1415 models:: { repos:: Release , workflows:: WorkflowListArtifact } ,
1516 params:: actions:: ArchiveFormat ,
16- Octocrab , OctocrabBuilder ,
1717 } ,
1818 rayon:: prelude:: * ,
1919 reqwest:: { Client , StatusCode } ,
2020 reqwest_retry:: {
21- default_on_request_failure , policies :: ExponentialBackoff , RetryPolicy , Retryable ,
22- RetryableStrategy ,
21+ RetryPolicy , Retryable , RetryableStrategy , default_on_request_failure ,
22+ policies :: ExponentialBackoff ,
2323 } ,
2424 sha2:: { Digest , Sha256 } ,
2525 std:: {
@@ -70,6 +70,7 @@ enum UploadSource {
7070 Data ( Bytes ) ,
7171}
7272
73+ #[ allow( clippy:: too_many_arguments) ]
7374async fn upload_release_artifact (
7475 client : & Client ,
7576 retry_policy : & impl RetryPolicy ,
@@ -286,16 +287,13 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
286287 let parts = name. split ( '-' ) . collect :: < Vec < _ > > ( ) ;
287288
288289 if parts[ 0 ] != "cpython" {
289- println ! ( "ignoring {} not a cpython artifact" , name ) ;
290+ println ! ( "ignoring {name } not a cpython artifact" ) ;
290291 continue ;
291292 } ;
292293
293294 let python_version = pep440_rs:: Version :: from_str ( parts[ 1 ] ) ?;
294295 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}" ) ;
299297 continue ;
300298 }
301299
@@ -310,17 +308,14 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
310308 }
311309 } )
312310 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" ) ;
317312 continue ;
318313 } ;
319314
320315 let stripped_name = if let Some ( s) = name. strip_suffix ( ".tar.zst" ) {
321316 s
322317 } else {
323- println ! ( "ignoring {} not a .tar.zst artifact" , name ) ;
318+ println ! ( "ignoring {name } not a .tar.zst artifact" ) ;
324319 continue ;
325320 } ;
326321
@@ -333,7 +328,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
333328 let build_suffix = & stripped_name[ triple_start + triple. len ( ) + 1 ..] ;
334329
335330 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" ) ;
337332 continue ;
338333 }
339334
@@ -342,7 +337,7 @@ pub async fn command_fetch_release_distributions(args: &ArgMatches) -> Result<()
342337 zf. read_to_end ( & mut buf) ?;
343338 std:: fs:: write ( & dest_path, & buf) ?;
344339
345- println ! ( "prepared {} for release" , name ) ;
340+ println ! ( "prepared {name } for release" ) ;
346341
347342 if build_suffix == release. install_only_suffix {
348343 install_paths. push ( dest_path) ;
@@ -452,34 +447,19 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
452447
453448 for suffix in release. suffixes ( Some ( & python_version) ) {
454449 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" ) ,
463452 ) ;
464453 }
465454
466455 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" ) ,
472458 ) ;
473459
474460 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" ) ,
483463 ) ;
484464 }
485465 }
@@ -490,7 +470,7 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
490470 . collect :: < Vec < _ > > ( ) ;
491471
492472 for f in & missing {
493- println ! ( "missing release artifact: {}" , f ) ;
473+ println ! ( "missing release artifact: {f}" ) ;
494474 }
495475 if missing. is_empty ( ) {
496476 println ! ( "found all {} release artifacts" , wanted_filenames. len( ) ) ;
@@ -564,7 +544,7 @@ pub async fn command_upload_release_distributions(args: &ArgMatches) -> Result<(
564544
565545 let shasums = digests
566546 . iter ( )
567- . map ( |( filename, digest) | format ! ( "{} {}\n " , digest , filename ) )
547+ . map ( |( filename, digest) | format ! ( "{digest } {filename }\n " ) )
568548 . collect :: < Vec < _ > > ( )
569549 . join ( "" ) ;
570550
0 commit comments