File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -263,12 +263,14 @@ impl ServerBuilder {
263263 info ! ( "Starting {} workers" , self . threads) ;
264264
265265 // start workers
266- let mut workers = Vec :: new ( ) ;
267- for idx in 0 ..self . threads {
268- let worker = self . start_worker ( idx, self . accept . get_notify ( ) ) ;
269- workers. push ( worker. clone ( ) ) ;
270- self . workers . push ( ( idx, worker) ) ;
271- }
266+ let workers = ( 0 ..self . threads )
267+ . map ( |idx| {
268+ let worker = self . start_worker ( idx, self . accept . get_notify ( ) ) ;
269+ self . workers . push ( ( idx, worker. clone ( ) ) ) ;
270+
271+ worker
272+ } )
273+ . collect ( ) ;
272274
273275 // start accept thread
274276 for sock in & self . sockets {
@@ -380,7 +382,7 @@ impl ServerBuilder {
380382 . await ;
381383 System :: current ( ) . stop ( ) ;
382384 }
383- . boxed ( ) ,
385+ . boxed ( ) ,
384386 ) ;
385387 }
386388 ready ( ( ) )
You can’t perform that action at this time.
0 commit comments