@@ -81,7 +81,7 @@ pub enum ContainerCommand {
8181fn parse_key_val ( s : & str ) -> Result < ( String , String ) , String > {
8282 s. split_once ( '=' )
8383 . map ( |( key, value) | ( key. to_string ( ) , value. to_string ( ) ) )
84- . ok_or_else ( || format ! ( "invalid KEY=value format: {}" , s ) )
84+ . ok_or_else ( || format ! ( "invalid KEY=value format: {s}" ) )
8585}
8686
8787pub async fn handle_container_command ( args : ContainerArgs ) -> Result < ( ) > {
@@ -113,7 +113,7 @@ async fn create_container(
113113 cmd : Vec < String > ,
114114 env : Vec < ( String , String ) > ,
115115) -> Result < ( ) > {
116- println ! ( "Requesting container creation with image: {}..." , image_ref ) ;
116+ println ! ( "Requesting container creation with image: {image_ref }..." ) ;
117117
118118 let config = ContainerConfig {
119119 image_ref,
@@ -140,23 +140,23 @@ async fn create_container(
140140}
141141
142142async fn start_container ( client : & mut ContainerServiceClient < Channel > , id : String ) -> Result < ( ) > {
143- println ! ( "Requesting to start container: {}..." , id ) ;
143+ println ! ( "Requesting to start container: {id }..." ) ;
144144 let request = StartContainerRequest {
145145 container_id : id. clone ( ) ,
146146 } ;
147147 client. start_container ( request) . await ?;
148- println ! ( "Start request sent for container: {}" , id ) ;
148+ println ! ( "Start request sent for container: {id}" ) ;
149149 Ok ( ( ) )
150150}
151151
152152async fn stop_container ( client : & mut ContainerServiceClient < Channel > , id : String ) -> Result < ( ) > {
153- println ! ( "Requesting to stop container: {}..." , id ) ;
153+ println ! ( "Requesting to stop container: {id }..." ) ;
154154 let request = StopContainerRequest {
155155 container_id : id. clone ( ) ,
156156 ..Default :: default ( )
157157 } ;
158158 client. stop_container ( request) . await ?;
159- println ! ( "Stop request sent for container: {}" , id ) ;
159+ println ! ( "Stop request sent for container: {id}" ) ;
160160 Ok ( ( ) )
161161}
162162
@@ -169,16 +169,16 @@ async fn get_container_info(
169169 } ;
170170 let response = client. get_container ( request) . await ?. into_inner ( ) ;
171171
172- println ! ( "Container Info for: {}" , id ) ;
172+ println ! ( "Container Info for: {id}" ) ;
173173 println ! (
174174 " State: {:?}" ,
175175 ContainerState :: try_from( response. state) . unwrap_or( ContainerState :: Unspecified )
176176 ) ;
177177 if let Some ( pid) = response. pid {
178- println ! ( " PID: {}" , pid ) ;
178+ println ! ( " PID: {pid}" ) ;
179179 }
180180 if let Some ( exit_code) = response. exit_code {
181- println ! ( " Exit Code: {}" , exit_code ) ;
181+ println ! ( " Exit Code: {exit_code}" ) ;
182182 }
183183 if let Some ( config) = response. config {
184184 println ! ( " Config:" ) ;
@@ -223,11 +223,11 @@ async fn list_containers(client: &mut ContainerServiceClient<Channel>) -> Result
223223}
224224
225225async fn delete_container ( client : & mut ContainerServiceClient < Channel > , id : String ) -> Result < ( ) > {
226- println ! ( "Requesting to delete container: {}..." , id ) ;
226+ println ! ( "Requesting to delete container: {id }..." ) ;
227227 let request = DeleteContainerRequest {
228228 container_id : id. clone ( ) ,
229229 } ;
230230 client. delete_container ( request) . await ?;
231- println ! ( "Successfully deleted container: {}" , id ) ;
231+ println ! ( "Successfully deleted container: {id}" ) ;
232232 Ok ( ( ) )
233233}
0 commit comments