File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
09_01_sync_tcp_server/src
09_05_final_tcp_server/src Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,12 @@ async fn blocks() {
62
62
63
63
let future_one = async {
64
64
// ...
65
- println ! ( "{}" , my_string ) ;
65
+ println ! ( "{my_string}" ) ;
66
66
} ;
67
67
68
68
let future_two = async {
69
69
// ...
70
- println ! ( "{}" , my_string ) ;
70
+ println ! ( "{my_string}" ) ;
71
71
} ;
72
72
73
73
// Run both futures to completion, printing "foo" twice:
@@ -84,7 +84,7 @@ fn move_block() -> impl Future<Output = ()> {
84
84
let my_string = "foo" . to_string ( ) ;
85
85
async move {
86
86
// ...
87
- println ! ( "{}" , my_string ) ;
87
+ println ! ( "{my_string}" ) ;
88
88
}
89
89
}
90
90
// ANCHOR_END: async_move_examples
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ fn handle_connection(mut stream: TcpStream) {
33
33
34
34
// Write response back to the stream,
35
35
// and flush the stream to ensure the response is sent back to the client
36
- let response = format ! ( "{}{}" , status_line , contents ) ;
36
+ let response = format ! ( "{status_line}{contents}" ) ;
37
37
stream. write ( response. as_bytes ( ) ) . unwrap ( ) ;
38
38
stream. flush ( ) . unwrap ( ) ;
39
39
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ async fn handle_connection(mut stream: TcpStream) {
33
33
} ;
34
34
let contents = fs:: read_to_string ( filename) . unwrap ( ) ;
35
35
36
- let response = format ! ( "{}{}" , status_line , contents ) ;
36
+ let response = format ! ( "{status_line}{contents}" ) ;
37
37
stream. write ( response. as_bytes ( ) ) . unwrap ( ) ;
38
38
stream. flush ( ) . unwrap ( ) ;
39
39
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ async fn handle_connection(mut stream: impl Read + Write + Unpin) {
33
33
( "HTTP/1.1 404 NOT FOUND\r \n \r \n " , "404.html" )
34
34
} ;
35
35
let contents = fs:: read_to_string ( filename) . unwrap ( ) ;
36
- let response = format ! ( "{}{}" , status_line , contents ) ;
36
+ let response = format ! ( "{status_line}{contents}" ) ;
37
37
stream. write ( response. as_bytes ( ) ) . await . unwrap ( ) ;
38
38
stream. flush ( ) . await . unwrap ( ) ;
39
39
}
You can’t perform that action at this time.
0 commit comments