@@ -55,7 +55,7 @@ async fn echo_handler<T: IoBufMut>(
55
55
peer : SocketAddr ,
56
56
registry : FixedBufRegistry < T > ,
57
57
) {
58
- println ! ( "peer {} connected" , peer ) ;
58
+ println ! ( "peer {peer } connected" ) ;
59
59
60
60
// Get one of the two fixed buffers.
61
61
// If neither is unavailable, print reason and return immediately, dropping this connection;
@@ -68,7 +68,7 @@ async fn echo_handler<T: IoBufMut>(
68
68
} ;
69
69
if fbuf. is_none ( ) {
70
70
let _ = stream. shutdown ( std:: net:: Shutdown :: Write ) ;
71
- println ! ( "peer {} closed, no fixed buffers available" , peer ) ;
71
+ println ! ( "peer {peer } closed, no fixed buffers available" ) ;
72
72
return ;
73
73
} ;
74
74
@@ -90,13 +90,13 @@ async fn echo_handler<T: IoBufMut>(
90
90
let ( res, nslice) = stream. write_fixed_all ( fbuf1. slice ( ..read) ) . await ;
91
91
92
92
res. unwrap ( ) ;
93
- println ! ( "peer {} all {} bytes ping-ponged" , peer , read ) ;
93
+ println ! ( "peer {peer } all {read } bytes ping-ponged" ) ;
94
94
n += read;
95
95
96
96
// Important. One of the points of this example.
97
97
nslice. into_inner ( ) // Return the buffer we started with.
98
98
} ;
99
99
}
100
100
let _ = stream. shutdown ( std:: net:: Shutdown :: Write ) ;
101
- println ! ( "peer {} closed, {} total ping-ponged" , peer , n ) ;
101
+ println ! ( "peer {peer } closed, {n } total ping-ponged" ) ;
102
102
}
0 commit comments