@@ -60,7 +60,7 @@ mod tests {
6060 . duration_since ( std:: time:: UNIX_EPOCH )
6161 . unwrap ( )
6262 . as_nanos ( ) ;
63- let namespace = format ! ( "save-rust-{}-{}" , test_name , timestamp ) ;
63+ let namespace = format ! ( "save-rust-{test_name }-{timestamp}" ) ;
6464 let path = TmpDir :: new ( test_name) . await . unwrap ( ) ;
6565 ( path, namespace)
6666 }
@@ -103,7 +103,7 @@ mod tests {
103103 Duration :: from_secs ( 30 )
104104 } ;
105105
106- log:: info!( "Waiting for public internet to be ready (timeout: {:?})" , timeout ) ;
106+ log:: info!( "Waiting for public internet to be ready (timeout: {timeout :?})" ) ;
107107
108108 // Try up to 6 times with exponential backoff
109109 let mut retry_count = 0 ;
@@ -114,13 +114,13 @@ mod tests {
114114 while let Ok ( update) = rx. recv ( ) . await {
115115 match & update {
116116 VeilidUpdate :: Attachment ( attachment_state) => {
117- log:: debug!( "Veilid attachment state: {:?}" , attachment_state ) ;
117+ log:: debug!( "Veilid attachment state: {attachment_state :?}" ) ;
118118 if attachment_state. public_internet_ready {
119119 log:: info!( "Public internet is ready!" ) ;
120120 return Ok ( ( ) ) ;
121121 }
122122 }
123- _ => log:: trace!( "Received Veilid update: {:?}" , update ) ,
123+ _ => log:: trace!( "Received Veilid update: {update :?}" ) ,
124124 }
125125 }
126126 Err ( anyhow:: anyhow!( "Update channel closed before network was ready" ) )
@@ -130,8 +130,8 @@ mod tests {
130130 retry_count += 1 ;
131131 if retry_count < max_retries {
132132 let backoff = Duration :: from_secs ( 2u64 . pow ( retry_count as u32 ) ) ;
133- log:: warn!( "Timeout waiting for public internet (attempt {}/{})" , retry_count , max_retries ) ;
134- log:: info!( "Retrying in {:?}..." , backoff ) ;
133+ log:: warn!( "Timeout waiting for public internet (attempt {retry_count }/{max_retries })" ) ;
134+ log:: info!( "Retrying in {backoff :?}..." ) ;
135135 tokio:: time:: sleep ( backoff) . await ;
136136 // Resubscribe to get a fresh update channel
137137 rx = backend. subscribe_updates ( ) . await . ok_or_else ( || anyhow:: anyhow!( "No update receiver" ) ) ?;
@@ -140,7 +140,7 @@ mod tests {
140140 }
141141 }
142142
143- Err ( anyhow:: anyhow!( "Failed to establish public internet connection after {} attempts" , max_retries ) )
143+ Err ( anyhow:: anyhow!( "Failed to establish public internet connection after {max_retries } attempts" ) )
144144 }
145145
146146 // Helper function to properly clean up test resources
@@ -241,7 +241,7 @@ mod tests {
241241
242242 // Step 2: Create a repo via the API
243243 let create_repo_req = test:: TestRequest :: post ( )
244- . uri ( & format ! ( "/api/groups/{}/repos" , group_id ) )
244+ . uri ( & format ! ( "/api/groups/{group_id }/repos" ) )
245245 . set_json ( json ! ( { "name" : "Test Repo" } ) )
246246 . to_request ( ) ;
247247 let create_repo_resp: serde_json:: Value =
@@ -257,8 +257,7 @@ mod tests {
257257
258258 let upload_req = test:: TestRequest :: post ( )
259259 . uri ( & format ! (
260- "/api/groups/{}/repos/{}/media/{}" ,
261- group_id, repo_id, file_name
260+ "/api/groups/{group_id}/repos/{repo_id}/media/{file_name}"
262261 ) )
263262 . set_payload ( file_content. to_vec ( ) )
264263 . to_request ( ) ;
@@ -269,12 +268,12 @@ mod tests {
269268
270269 // Step 4: List files in the repository
271270 let list_files_req = test:: TestRequest :: get ( )
272- . uri ( & format ! ( "/api/groups/{}/repos/{}/media" , group_id , repo_id ) )
271+ . uri ( & format ! ( "/api/groups/{group_id }/repos/{repo_id }/media" ) )
273272 . to_request ( ) ;
274273 let list_files_resp: FilesResponse =
275274 test:: call_and_read_body_json ( & app, list_files_req) . await ;
276275
277- println ! ( "List files response: {:?}" , list_files_resp ) ;
276+ println ! ( "List files response: {list_files_resp :?}" ) ;
278277
279278 // Now check if the response is an array directly
280279 let files_array = list_files_resp. files ;
@@ -289,8 +288,7 @@ mod tests {
289288
290289 let get_file_req = test:: TestRequest :: get ( )
291290 . uri ( & format ! (
292- "/api/groups/{}/repos/{}/media/{}" ,
293- group_id, repo_id, file_name
291+ "/api/groups/{group_id}/repos/{repo_id}/media/{file_name}"
294292 ) )
295293 . to_request ( ) ;
296294 let get_file_resp = test:: call_service ( & app, get_file_req) . await ;
@@ -316,7 +314,7 @@ mod tests {
316314
317315 // Step 6: Verify the file is no longer listed
318316 let list_files_after_deletion_req = test:: TestRequest :: get ( )
319- . uri ( & format ! ( "/api/groups/{}/repos/{}/media" , group_id , repo_id ) )
317+ . uri ( & format ! ( "/api/groups/{group_id }/repos/{repo_id }/media" ) )
320318 . to_request ( ) ;
321319 let list_files_after_deletion_resp: FilesResponse =
322320 test:: call_and_read_body_json ( & app, list_files_after_deletion_req) . await ;
@@ -524,7 +522,7 @@ mod tests {
524522 // Test refreshing non-existent group
525523 let fake_group_id = base64:: engine:: general_purpose:: URL_SAFE_NO_PAD . encode ( [ 0u8 ; 32 ] ) ;
526524 let non_existent_req = test:: TestRequest :: post ( )
527- . uri ( & format ! ( "/api/groups/{}/refresh" , fake_group_id ) )
525+ . uri ( & format ! ( "/api/groups/{fake_group_id }/refresh" ) )
528526 . to_request ( ) ;
529527 let non_existent_resp = test:: call_service ( & app, non_existent_req) . await ;
530528 assert ! ( non_existent_resp. status( ) . is_client_error( ) , "Should return error for non-existent group" ) ;
@@ -593,12 +591,12 @@ mod tests {
593591
594592 // Wait for public internet readiness
595593 log:: info!( "Waiting for public internet readiness..." ) ;
596- wait_for_public_internet_ready ( & * backend) . await ?;
594+ wait_for_public_internet_ready ( & backend) . await ?;
597595 log:: info!( "Public internet is ready" ) ;
598596
599597 let mut group = backend. create_group ( ) . await ?;
600598 group. set_name ( TEST_GROUP_NAME ) . await ?;
601- log:: info!( "Created group with name: {}" , TEST_GROUP_NAME ) ;
599+ log:: info!( "Created group with name: {TEST_GROUP_NAME}" ) ;
602600
603601 let repo = group. create_repo ( ) . await ?;
604602 repo. set_name ( "Test Repo" ) . await ?;
@@ -608,7 +606,7 @@ mod tests {
608606 let dummy_file_name = "dummy.txt" ;
609607 let dummy_file_content = b"dummy content" . to_vec ( ) ;
610608 repo. upload ( dummy_file_name, dummy_file_content. clone ( ) ) . await ?;
611- log:: info!( "Uploaded dummy file: {}" , dummy_file_name ) ;
609+ log:: info!( "Uploaded dummy file: {dummy_file_name}" ) ;
612610
613611 ( group, repo, dummy_file_name, dummy_file_content)
614612 } ;
@@ -634,7 +632,7 @@ mod tests {
634632
635633 // Parse and verify response data
636634 let refresh_data: serde_json:: Value = test:: read_body_json ( refresh_resp) . await ;
637- log:: info!( "Refresh response: {:?}" , refresh_data ) ;
635+ log:: info!( "Refresh response: {refresh_data :?}" ) ;
638636
639637 assert_eq ! ( refresh_data[ "status" ] , "success" , "Response should indicate success" ) ;
640638
0 commit comments