@@ -57,7 +57,7 @@ pub fn assign_workers(
5757 if let Some ( core_id) = core_ids. pop ( ) {
5858 result. push ( ( core_id, worker_type) ) ;
5959 * worker_counts. entry ( worker_type) . or_insert ( 0 ) += 1 ;
60- worker_cores. entry ( worker_type) . or_insert_with ( Vec :: new ) . push ( core_id) ;
60+ worker_cores. entry ( worker_type) . or_default ( ) . push ( core_id) ;
6161 remaining_cores -= 1 ;
6262 }
6363 }
@@ -74,7 +74,7 @@ pub fn assign_workers(
7474 if let Some ( core_id) = core_ids. pop ( ) {
7575 result. push ( ( core_id, * worker_type) ) ;
7676 * worker_counts. entry ( * worker_type) . or_insert ( 0 ) += 1 ;
77- worker_cores. entry ( * worker_type) . or_insert_with ( Vec :: new ) . push ( core_id) ;
77+ worker_cores. entry ( * worker_type) . or_default ( ) . push ( core_id) ;
7878 remaining_cores -= 1 ;
7979 }
8080 }
@@ -87,26 +87,26 @@ pub fn assign_workers(
8787 if let Some ( core_id) = core_ids. pop ( ) {
8888 result. push ( ( core_id, worker_type) ) ;
8989 * worker_counts. entry ( worker_type) . or_insert ( 0 ) += 1 ;
90- worker_cores. entry ( worker_type) . or_insert_with ( Vec :: new ) . push ( core_id) ;
90+ worker_cores. entry ( worker_type) . or_default ( ) . push ( core_id) ;
9191 }
9292 }
9393 }
9494
95- println ! ( "[+] Spawning {} workers:" , total_starting_cores ) ;
95+ println ! ( "[+] Spawning {total_starting_cores } workers:" ) ;
9696 for ( worker_type, count) in worker_counts. clone ( ) {
9797 if log_core_ranges {
9898 if let Some ( cores) = worker_cores. get ( & worker_type) {
9999 let mut core_ids: Vec < usize > = cores. iter ( ) . map ( |c| c. id ) . collect ( ) ;
100100 core_ids. sort ( ) ;
101101
102102 let core_str = match core_ids. as_slice ( ) {
103- [ single] => format ! ( "core {}" , single ) ,
103+ [ single] => format ! ( "core {single}" ) ,
104104 ids => format ! ( "cores {}" , format_ranges( ids) ) ,
105105 } ;
106- println ! ( "- {:?}: {} ({})" , worker_type , count , core_str ) ;
106+ println ! ( "- {worker_type :?}: {count } ({core_str })" ) ;
107107 }
108108 } else {
109- println ! ( "- {:?}: {}" , worker_type , count ) ;
109+ println ! ( "- {worker_type :?}: {count}" ) ;
110110 }
111111 }
112112
0 commit comments