@@ -155,8 +155,7 @@ impl AggregatorHTTPClient {
155
155
) )
156
156
} else {
157
157
AggregatorHandlerError :: ApiVersionMismatch ( format ! (
158
- "version precondition failed, sent version '{}'." ,
159
- MITHRIL_API_VERSION
158
+ "version precondition failed, sent version '{MITHRIL_API_VERSION}'."
160
159
) )
161
160
}
162
161
}
@@ -314,8 +313,7 @@ impl CertificateRetriever for AggregatorHTTPClient {
314
313
/// Computes local archive filepath
315
314
fn archive_file_path ( digest : & str , network : & str ) -> Result < PathBuf , AggregatorHandlerError > {
316
315
Ok ( env:: current_dir ( ) ?. join ( path:: Path :: new ( & format ! (
317
- "data/{}/{}/snapshot.archive.tar.gz" ,
318
- network, digest
316
+ "data/{network}/{digest}/snapshot.archive.tar.gz"
319
317
) ) ) )
320
318
}
321
319
@@ -362,7 +360,7 @@ mod tests {
362
360
. join ( path:: Path :: new ( data_file_name) ) ;
363
361
fs:: create_dir_all ( source_file_path. parent ( ) . unwrap ( ) ) . unwrap ( ) ;
364
362
let mut source_file = fs:: File :: create ( & source_file_path) . unwrap ( ) ;
365
- write ! ( source_file, "{}" , data_expected ) . unwrap ( ) ;
363
+ write ! ( source_file, "{data_expected}" ) . unwrap ( ) ;
366
364
let archive_file = fs:: File :: create ( & archive_file_path) . unwrap ( ) ;
367
365
let archive_encoder = GzEncoder :: new ( & archive_file, Compression :: default ( ) ) ;
368
366
let mut archive_builder = tar:: Builder :: new ( archive_encoder) ;
@@ -428,7 +426,7 @@ mod tests {
428
426
let ( server, config) = setup_test ( ) ;
429
427
let snapshot_expected = fake_data:: snapshots ( 1 ) . first ( ) . unwrap ( ) . to_owned ( ) ;
430
428
let _snapshots_mock = server. mock ( |when, then| {
431
- when. path ( format ! ( "/snapshot/{}" , digest ) ) ;
429
+ when. path ( format ! ( "/snapshot/{digest}" ) ) ;
432
430
then. status ( 200 ) . body ( json ! ( snapshot_expected) . to_string ( ) ) ;
433
431
} ) ;
434
432
let aggregator_client =
@@ -443,7 +441,7 @@ mod tests {
443
441
let digest = "digest123" ;
444
442
let ( server, config) = setup_test ( ) ;
445
443
let _snapshots_mock = server. mock ( |when, then| {
446
- when. path ( format ! ( "/snapshot/{}" , digest ) ) ;
444
+ when. path ( format ! ( "/snapshot/{digest}" ) ) ;
447
445
then. status ( 404 ) ;
448
446
} ) ;
449
447
let aggregator_client =
@@ -457,7 +455,7 @@ mod tests {
457
455
let ( server, config) = setup_test ( ) ;
458
456
let digest = "digest123" ;
459
457
let _snapshots_mock = server. mock ( |when, then| {
460
- when. path ( format ! ( "/snapshot/{}" , digest ) ) ;
458
+ when. path ( format ! ( "/snapshot/{digest}" ) ) ;
461
459
then. status ( 412 ) . header ( "mithril-api-version" , "0.0.999" ) ;
462
460
} ) ;
463
461
let aggregator_client =
@@ -475,7 +473,7 @@ mod tests {
475
473
let digest = "digest123" ;
476
474
let ( server, config) = setup_test ( ) ;
477
475
let _snapshots_mock = server. mock ( |when, then| {
478
- when. path ( format ! ( "/snapshot/{}" , digest ) ) ;
476
+ when. path ( format ! ( "/snapshot/{digest}" ) ) ;
479
477
then. status ( 500 ) ;
480
478
} ) ;
481
479
let aggregator_client =
@@ -594,7 +592,7 @@ mod tests {
594
592
let ( server, config) = setup_test ( ) ;
595
593
let certificate_hash = "certificate-hash-123" ;
596
594
let _snapshots_mock = server. mock ( |when, then| {
597
- when. path ( format ! ( "/certificate/{}" , certificate_hash ) ) ;
595
+ when. path ( format ! ( "/certificate/{certificate_hash}" ) ) ;
598
596
then. status ( 412 ) . header ( "mithril-api-version" , "0.0.999" ) ;
599
597
} ) ;
600
598
let aggregator_client =
@@ -611,7 +609,7 @@ mod tests {
611
609
let ( server, config) = setup_test ( ) ;
612
610
let certificate_expected = fake_data:: certificate ( certificate_hash. to_string ( ) ) ;
613
611
let _certificate_mock = server. mock ( |when, then| {
614
- when. path ( format ! ( "/certificate/{}" , certificate_hash ) ) ;
612
+ when. path ( format ! ( "/certificate/{certificate_hash}" ) ) ;
615
613
then. status ( 200 )
616
614
. body ( json ! ( certificate_expected) . to_string ( ) ) ;
617
615
} ) ;
@@ -629,7 +627,7 @@ mod tests {
629
627
let certificate_hash = "certificate-hash-123" ;
630
628
let ( server, config) = setup_test ( ) ;
631
629
let _certificate_mock = server. mock ( |when, then| {
632
- when. path ( format ! ( "/certificate/{}" , certificate_hash ) ) ;
630
+ when. path ( format ! ( "/certificate/{certificate_hash}" ) ) ;
633
631
then. status ( 404 ) ;
634
632
} ) ;
635
633
let aggregator_client =
@@ -645,7 +643,7 @@ mod tests {
645
643
let certificate_hash = "certificate-hash-123" ;
646
644
let ( server, config) = setup_test ( ) ;
647
645
let _certificate_mock = server. mock ( |when, then| {
648
- when. path ( format ! ( "/certificate/{}" , certificate_hash ) ) ;
646
+ when. path ( format ! ( "/certificate/{certificate_hash}" ) ) ;
649
647
then. status ( 500 ) ;
650
648
} ) ;
651
649
let aggregator_client =
0 commit comments