File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -18,25 +18,26 @@ use std::io::prelude::*;
1818use std:: net:: { TcpListener , TcpStream } ;
1919use std:: process;
2020use std:: sync:: mpsc:: channel;
21+ use std:: time:: Duration ;
2122use std:: thread:: { self , Builder } ;
2223
2324fn main ( ) {
2425 // This test has a chance to time out, try to not let it time out
2526 thread:: spawn ( move || -> ( ) {
26- thread:: sleep_ms ( 30 * 1000 ) ;
27+ thread:: sleep ( Duration :: from_secs ( 30 ) ) ;
2728 process:: exit ( 1 ) ;
2829 } ) ;
2930
30- let mut listener = TcpListener :: bind ( "127.0.0.1:0" ) . unwrap ( ) ;
31+ let listener = TcpListener :: bind ( "127.0.0.1:0" ) . unwrap ( ) ;
3132 let addr = listener. local_addr ( ) . unwrap ( ) ;
3233 thread:: spawn ( move || -> ( ) {
3334 loop {
3435 let mut stream = match listener. accept ( ) {
3536 Ok ( stream) => stream. 0 ,
36- Err ( error ) => continue ,
37+ Err ( _ ) => continue ,
3738 } ;
38- stream. read ( & mut [ 0 ] ) ;
39- stream. write ( & [ 2 ] ) ;
39+ let _ = stream. read ( & mut [ 0 ] ) ;
40+ let _ = stream. write ( & [ 2 ] ) ;
4041 }
4142 } ) ;
4243
@@ -47,8 +48,8 @@ fn main() {
4748 let res = Builder :: new ( ) . stack_size ( 64 * 1024 ) . spawn ( move || {
4849 match TcpStream :: connect ( addr) {
4950 Ok ( mut stream) => {
50- stream. write ( & [ 1 ] ) ;
51- stream. read ( & mut [ 0 ] ) ;
51+ let _ = stream. write ( & [ 1 ] ) ;
52+ let _ = stream. read ( & mut [ 0 ] ) ;
5253 } ,
5354 Err ( ..) => { }
5455 }
You can’t perform that action at this time.
0 commit comments