@@ -31,13 +31,13 @@ mod test {
3131 // verify res is ok and not 404
3232 match res {
3333 Ok ( _) => {
34- println ! ( "response_code: {}" , response_code ) ;
34+ println ! ( "response_code: {response_code}" ) ;
3535 if response_code / 100 == 2 {
3636 break ; // 2xx response
3737 }
3838 }
3939 Err ( e) => {
40- println ! ( "res: {}, response_code: {}" , e , response_code ) ;
40+ println ! ( "res: {e }, response_code: {response_code}" ) ;
4141 }
4242 }
4343 i += 1 ;
@@ -55,9 +55,9 @@ mod test {
5555 let host_port = 8082 ;
5656
5757 // curl for hello
58- println ! ( " >>> curl http://localhost:{}/spin/hello" , host_port ) ;
58+ println ! ( " >>> curl http://localhost:{host_port }/spin/hello" ) ;
5959 let res = retry_get (
60- & format ! ( "http://localhost:{}/spin/hello" , host_port ) ,
60+ & format ! ( "http://localhost:{host_port }/spin/hello" ) ,
6161 RETRY_TIMES ,
6262 INTERVAL_IN_SECS ,
6363 )
@@ -72,9 +72,9 @@ mod test {
7272 let host_port = 8082 ;
7373
7474 // curl for hello
75- println ! ( " >>> curl http://localhost:{}/keyvalue/keyvalue" , host_port ) ;
75+ println ! ( " >>> curl http://localhost:{host_port }/keyvalue/keyvalue" ) ;
7676 let res = retry_get (
77- & format ! ( "http://localhost:{}/keyvalue/keyvalue" , host_port ) ,
77+ & format ! ( "http://localhost:{host_port }/keyvalue/keyvalue" ) ,
7878 RETRY_TIMES ,
7979 INTERVAL_IN_SECS ,
8080 )
@@ -96,16 +96,13 @@ mod test {
9696
9797 let forward_port = port_forward_svc ( redis_port, "redis" ) . await ?;
9898
99- let client = redis:: Client :: open ( format ! ( "redis://localhost:{}" , forward_port ) ) ?;
99+ let client = redis:: Client :: open ( format ! ( "redis://localhost:{forward_port}" ) ) ?;
100100 let mut con = client. get_multiplexed_async_connection ( ) . await ?;
101101
102102 // curl for hello
103- println ! (
104- " >>> curl http://localhost:{}/outboundredis/hello" ,
105- host_port
106- ) ;
103+ println ! ( " >>> curl http://localhost:{host_port}/outboundredis/hello" ) ;
107104 let _ = retry_get (
108- & format ! ( "http://localhost:{}/outboundredis/hello" , host_port ) ,
105+ & format ! ( "http://localhost:{host_port }/outboundredis/hello" ) ,
109106 RETRY_TIMES ,
110107 INTERVAL_IN_SECS ,
111108 )
@@ -126,9 +123,9 @@ mod test {
126123 let host_port = 8082 ;
127124
128125 // curl for hello
129- println ! ( " >>> curl http://localhost:{}/multi-trigger-app" , host_port ) ;
126+ println ! ( " >>> curl http://localhost:{host_port }/multi-trigger-app" ) ;
130127 let res = retry_get (
131- & format ! ( "http://localhost:{}/multi-trigger-app" , host_port ) ,
128+ & format ! ( "http://localhost:{host_port }/multi-trigger-app" ) ,
132129 RETRY_TIMES ,
133130 INTERVAL_IN_SECS ,
134131 )
@@ -147,7 +144,7 @@ mod test {
147144
148145 let forward_port = port_forward_svc ( redis_port, "redis" ) . await ?;
149146
150- let client = redis:: Client :: open ( format ! ( "redis://localhost:{}" , forward_port ) )
147+ let client = redis:: Client :: open ( format ! ( "redis://localhost:{forward_port}" ) )
151148 . context ( "connecting to redis" ) ?;
152149 let mut con = client. get_multiplexed_async_connection ( ) . await ?;
153150
@@ -225,15 +222,9 @@ mod test {
225222 let host_port = 8082 ;
226223
227224 // curl for static asset
228- println ! (
229- " >>> curl http://localhost:{}/static-assets/jabberwocky.txt" ,
230- host_port
231- ) ;
225+ println ! ( " >>> curl http://localhost:{host_port}/static-assets/jabberwocky.txt" ) ;
232226 let res = retry_get (
233- & format ! (
234- "http://localhost:{}/static-assets/jabberwocky.txt" ,
235- host_port
236- ) ,
227+ & format ! ( "http://localhost:{host_port}/static-assets/jabberwocky.txt" ) ,
237228 RETRY_TIMES ,
238229 INTERVAL_IN_SECS ,
239230 )
@@ -260,15 +251,12 @@ mod test {
260251 async fn port_forward_svc ( svc_port : u16 , svc_name : & str ) -> Result < u16 > {
261252 let port = get_random_port ( ) ?;
262253
263- println ! (
264- " >>> kubectl portforward svc {} {}:{} " ,
265- svc_name, port, svc_port
266- ) ;
254+ println ! ( " >>> kubectl portforward svc {svc_name} {port}:{svc_port} " ) ;
267255
268256 Command :: new ( "kubectl" )
269257 . arg ( "port-forward" )
270258 . arg ( svc_name)
271- . arg ( format ! ( "{}:{}" , port , svc_port ) )
259+ . arg ( format ! ( "{port }:{svc_port}" ) )
272260 . spawn ( ) ?;
273261 tokio:: time:: sleep ( tokio:: time:: Duration :: from_secs ( 2 ) ) . await ;
274262 Ok ( port)
0 commit comments