File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
use atomic_counter:: AtomicCounter ;
2
- use std:: fs:: { create_dir_all , File } ;
2
+ use std:: fs:: { File , create_dir_all } ;
3
3
use std:: net:: { Ipv4Addr , SocketAddrV4 , TcpListener } ;
4
4
use std:: time:: Instant ;
5
5
use std:: { thread, time} ;
@@ -484,13 +484,15 @@ fn new_tcp_listener() -> TcpListener {
484
484
}
485
485
486
486
fn listen_async ( listener : TcpListener ) {
487
- thread:: spawn ( move || loop {
488
- match listener. accept ( ) {
489
- Ok ( _) => {
490
- println ! ( "Connection received!" ) ;
491
- }
492
- Err ( _) => {
493
- println ! ( "Error in received connection!" ) ;
487
+ thread:: spawn ( move || {
488
+ loop {
489
+ match listener. accept ( ) {
490
+ Ok ( _) => {
491
+ println ! ( "Connection received!" ) ;
492
+ }
493
+ Err ( _) => {
494
+ println ! ( "Error in received connection!" ) ;
495
+ }
494
496
}
495
497
}
496
498
} ) ;
You can’t perform that action at this time.
0 commit comments