@@ -2,6 +2,7 @@ use crate::{
22 store_data:: { ChecksumSeparation , Config , Disk , Distro , Source , WebSource } ,
33 utils:: { capture_page, GatherData , GithubAPI } ,
44} ;
5+ use join_futures:: join_futures;
56use quickemu:: config:: { Arch , DiskFormat } ;
67use quickget_core:: data_structures:: ArchiveFormat ;
78use regex:: Regex ;
@@ -68,13 +69,7 @@ impl Distro for Antix {
6869 }
6970 } ) ;
7071
71- futures:: future:: join_all ( futures)
72- . await
73- . into_iter ( )
74- . flatten ( )
75- . flatten ( )
76- . collect :: < Vec < Config > > ( )
77- . into ( )
72+ Some ( join_futures ! ( futures, 2 ) )
7873 }
7974}
8075
@@ -96,12 +91,7 @@ impl Distro for BunsenLabs {
9691 let url = format ! ( "{BUNSENLABS_MIRROR}{}" , & c[ 1 ] ) ;
9792 async move { ChecksumSeparation :: Whitespace . build ( & url) . await }
9893 } ) ;
99- let mut checksums = futures:: future:: join_all ( checksum_futures)
100- . await
101- . into_iter ( )
102- . flatten ( )
103- . flatten ( )
104- . collect :: < HashMap < String , String > > ( ) ;
94+ let mut checksums = join_futures ! ( checksum_futures, 2 , HashMap <String , String >) ;
10595
10696 release_regex
10797 . captures_iter ( & html)
@@ -254,14 +244,7 @@ impl Distro for Debian {
254244 } )
255245 . flatten ( ) ;
256246
257- futures:: future:: join_all ( futures)
258- . await
259- . into_iter ( )
260- . flatten ( )
261- . flatten ( )
262- . flatten ( )
263- . collect :: < Vec < Config > > ( )
264- . into ( )
247+ Some ( join_futures ! ( futures, 3 ) )
265248 }
266249}
267250
@@ -310,13 +293,7 @@ impl Distro for Devuan {
310293 )
311294 }
312295 } ) ;
313- futures:: future:: join_all ( futures)
314- . await
315- . into_iter ( )
316- . flatten ( )
317- . flatten ( )
318- . collect :: < Vec < Config > > ( )
319- . into ( )
296+ Some ( join_futures ! ( futures, 2 ) )
320297 }
321298}
322299
@@ -360,22 +337,10 @@ impl Distro for EasyOS {
360337 }
361338 } ) ;
362339
363- Some (
364- futures:: future:: join_all ( futures)
365- . await
366- . into_iter ( )
367- . flatten ( )
368- . collect :: < Vec < _ > > ( ) ,
369- )
340+ Some ( join_futures ! ( futures) )
370341 }
371342 } ) ;
372- let mut releases = futures:: future:: join_all ( release_futures)
373- . await
374- . into_iter ( )
375- . flatten ( )
376- . flatten ( )
377- . flatten ( )
378- . collect :: < Vec < _ > > ( ) ;
343+ let mut releases = join_futures ! ( release_futures, 4 , Vec <( String , String ) >) ;
379344
380345 releases. sort_by ( |( a, _) , ( b, _) | {
381346 if let ( Ok ( a) , Ok ( b) ) = (
@@ -425,12 +390,7 @@ impl Distro for EasyOS {
425390 } )
426391 }
427392 } ) ;
428- futures:: future:: join_all ( futures)
429- . await
430- . into_iter ( )
431- . flatten ( )
432- . collect :: < Vec < Config > > ( )
433- . into ( )
393+ Some ( join_futures ! ( futures, 1 ) )
434394 }
435395}
436396
@@ -478,17 +438,10 @@ impl Distro for EndlessOS {
478438 } )
479439 }
480440 } ) ;
481- Some ( futures :: future :: join_all ( futures) . await )
441+ Some ( join_futures ! ( futures) )
482442 }
483443 } ) ;
484444
485- futures:: future:: join_all ( futures)
486- . await
487- . into_iter ( )
488- . flatten ( )
489- . flatten ( )
490- . flatten ( )
491- . collect :: < Vec < _ > > ( )
492- . into ( )
445+ Some ( join_futures ! ( futures, 3 ) )
493446 }
494447}
0 commit comments