@@ -241,10 +241,10 @@ mod tests {
241
241
let second_value = 2 ;
242
242
list. insert_at_tail ( 1 ) ;
243
243
list. insert_at_tail ( second_value) ;
244
- println ! ( "Linked List is {}" , list ) ;
244
+ println ! ( "Linked List is {list}" ) ;
245
245
match list. get ( 1 ) {
246
246
Some ( val) => assert_eq ! ( * val, second_value) ,
247
- None => panic ! ( "Expected to find {} at index 1" , second_value ) ,
247
+ None => panic ! ( "Expected to find {second_value } at index 1" ) ,
248
248
}
249
249
}
250
250
#[ test]
@@ -253,10 +253,10 @@ mod tests {
253
253
let second_value = 2 ;
254
254
list. insert_at_head ( 1 ) ;
255
255
list. insert_at_head ( second_value) ;
256
- println ! ( "Linked List is {}" , list ) ;
256
+ println ! ( "Linked List is {list}" ) ;
257
257
match list. get ( 0 ) {
258
258
Some ( val) => assert_eq ! ( * val, second_value) ,
259
- None => panic ! ( "Expected to find {} at index 0" , second_value ) ,
259
+ None => panic ! ( "Expected to find {second_value } at index 0" ) ,
260
260
}
261
261
}
262
262
@@ -266,10 +266,10 @@ mod tests {
266
266
let second_value = 2 ;
267
267
list. insert_at_ith ( 0 , 0 ) ;
268
268
list. insert_at_ith ( 1 , second_value) ;
269
- println ! ( "Linked List is {}" , list ) ;
269
+ println ! ( "Linked List is {list}" ) ;
270
270
match list. get ( 1 ) {
271
271
Some ( val) => assert_eq ! ( * val, second_value) ,
272
- None => panic ! ( "Expected to find {} at index 1" , second_value ) ,
272
+ None => panic ! ( "Expected to find {second_value } at index 1" ) ,
273
273
}
274
274
}
275
275
@@ -279,10 +279,10 @@ mod tests {
279
279
let second_value = 2 ;
280
280
list. insert_at_ith ( 0 , 1 ) ;
281
281
list. insert_at_ith ( 0 , second_value) ;
282
- println ! ( "Linked List is {}" , list ) ;
282
+ println ! ( "Linked List is {list}" ) ;
283
283
match list. get ( 0 ) {
284
284
Some ( val) => assert_eq ! ( * val, second_value) ,
285
- None => panic ! ( "Expected to find {} at index 0" , second_value ) ,
285
+ None => panic ! ( "Expected to find {second_value } at index 0" ) ,
286
286
}
287
287
}
288
288
@@ -294,15 +294,15 @@ mod tests {
294
294
list. insert_at_ith ( 0 , 1 ) ;
295
295
list. insert_at_ith ( 1 , second_value) ;
296
296
list. insert_at_ith ( 1 , third_value) ;
297
- println ! ( "Linked List is {}" , list ) ;
297
+ println ! ( "Linked List is {list}" ) ;
298
298
match list. get ( 1 ) {
299
299
Some ( val) => assert_eq ! ( * val, third_value) ,
300
- None => panic ! ( "Expected to find {} at index 1" , third_value ) ,
300
+ None => panic ! ( "Expected to find {third_value } at index 1" ) ,
301
301
}
302
302
303
303
match list. get ( 2 ) {
304
304
Some ( val) => assert_eq ! ( * val, second_value) ,
305
- None => panic ! ( "Expected to find {} at index 1" , second_value ) ,
305
+ None => panic ! ( "Expected to find {second_value } at index 1" ) ,
306
306
}
307
307
}
308
308
@@ -331,7 +331,7 @@ mod tests {
331
331
] {
332
332
match list. get ( i) {
333
333
Some ( val) => assert_eq ! ( * val, expected) ,
334
- None => panic ! ( "Expected to find {} at index {}" , expected , i ) ,
334
+ None => panic ! ( "Expected to find {expected } at index {i}" ) ,
335
335
}
336
336
}
337
337
}
@@ -379,13 +379,13 @@ mod tests {
379
379
list. insert_at_tail ( second_value) ;
380
380
match list. delete_tail ( ) {
381
381
Some ( val) => assert_eq ! ( val, 2 ) ,
382
- None => panic ! ( "Expected to remove {} at tail" , second_value ) ,
382
+ None => panic ! ( "Expected to remove {second_value } at tail" ) ,
383
383
}
384
384
385
- println ! ( "Linked List is {}" , list ) ;
385
+ println ! ( "Linked List is {list}" ) ;
386
386
match list. get ( 0 ) {
387
387
Some ( val) => assert_eq ! ( * val, first_value) ,
388
- None => panic ! ( "Expected to find {} at index 0" , first_value ) ,
388
+ None => panic ! ( "Expected to find {first_value } at index 0" ) ,
389
389
}
390
390
}
391
391
@@ -398,13 +398,13 @@ mod tests {
398
398
list. insert_at_tail ( second_value) ;
399
399
match list. delete_head ( ) {
400
400
Some ( val) => assert_eq ! ( val, 1 ) ,
401
- None => panic ! ( "Expected to remove {} at head" , first_value ) ,
401
+ None => panic ! ( "Expected to remove {first_value } at head" ) ,
402
402
}
403
403
404
- println ! ( "Linked List is {}" , list ) ;
404
+ println ! ( "Linked List is {list}" ) ;
405
405
match list. get ( 0 ) {
406
406
Some ( val) => assert_eq ! ( * val, second_value) ,
407
- None => panic ! ( "Expected to find {} at index 0" , second_value ) ,
407
+ None => panic ! ( "Expected to find {second_value } at index 0" ) ,
408
408
}
409
409
}
410
410
@@ -417,7 +417,7 @@ mod tests {
417
417
list. insert_at_tail ( second_value) ;
418
418
match list. delete_ith ( 1 ) {
419
419
Some ( val) => assert_eq ! ( val, 2 ) ,
420
- None => panic ! ( "Expected to remove {} at tail" , second_value ) ,
420
+ None => panic ! ( "Expected to remove {second_value } at tail" ) ,
421
421
}
422
422
423
423
assert_eq ! ( list. length, 1 ) ;
@@ -432,7 +432,7 @@ mod tests {
432
432
list. insert_at_tail ( second_value) ;
433
433
match list. delete_ith ( 0 ) {
434
434
Some ( val) => assert_eq ! ( val, 1 ) ,
435
- None => panic ! ( "Expected to remove {} at tail" , first_value ) ,
435
+ None => panic ! ( "Expected to remove {first_value } at tail" ) ,
436
436
}
437
437
438
438
assert_eq ! ( list. length, 1 ) ;
@@ -449,12 +449,12 @@ mod tests {
449
449
list. insert_at_tail ( third_value) ;
450
450
match list. delete_ith ( 1 ) {
451
451
Some ( val) => assert_eq ! ( val, 2 ) ,
452
- None => panic ! ( "Expected to remove {} at tail" , second_value ) ,
452
+ None => panic ! ( "Expected to remove {second_value } at tail" ) ,
453
453
}
454
454
455
455
match list. get ( 1 ) {
456
456
Some ( val) => assert_eq ! ( * val, third_value) ,
457
- None => panic ! ( "Expected to find {} at index 1" , third_value ) ,
457
+ None => panic ! ( "Expected to find {third_value } at index 1" ) ,
458
458
}
459
459
}
460
460
@@ -464,7 +464,7 @@ mod tests {
464
464
list. insert_at_tail ( 1 ) ;
465
465
list. insert_at_tail ( 2 ) ;
466
466
list. insert_at_tail ( 3 ) ;
467
- println ! ( "Linked List is {}" , list ) ;
467
+ println ! ( "Linked List is {list}" ) ;
468
468
assert_eq ! ( 3 , list. length) ;
469
469
}
470
470
@@ -474,7 +474,7 @@ mod tests {
474
474
list_str. insert_at_tail ( "A" . to_string ( ) ) ;
475
475
list_str. insert_at_tail ( "B" . to_string ( ) ) ;
476
476
list_str. insert_at_tail ( "C" . to_string ( ) ) ;
477
- println ! ( "Linked List is {}" , list_str ) ;
477
+ println ! ( "Linked List is {list_str}" ) ;
478
478
assert_eq ! ( 3 , list_str. length) ;
479
479
}
480
480
@@ -483,7 +483,7 @@ mod tests {
483
483
let mut list = LinkedList :: < i32 > :: new ( ) ;
484
484
list. insert_at_tail ( 1 ) ;
485
485
list. insert_at_tail ( 2 ) ;
486
- println ! ( "Linked List is {}" , list ) ;
486
+ println ! ( "Linked List is {list}" ) ;
487
487
let retrived_item = list. get ( 1 ) ;
488
488
assert ! ( retrived_item. is_some( ) ) ;
489
489
assert_eq ! ( 2 , * retrived_item. unwrap( ) ) ;
@@ -494,7 +494,7 @@ mod tests {
494
494
let mut list_str = LinkedList :: < String > :: new ( ) ;
495
495
list_str. insert_at_tail ( "A" . to_string ( ) ) ;
496
496
list_str. insert_at_tail ( "B" . to_string ( ) ) ;
497
- println ! ( "Linked List is {}" , list_str ) ;
497
+ println ! ( "Linked List is {list_str}" ) ;
498
498
let retrived_item = list_str. get ( 1 ) ;
499
499
assert ! ( retrived_item. is_some( ) ) ;
500
500
assert_eq ! ( "B" , * retrived_item. unwrap( ) ) ;
0 commit comments