@@ -214,20 +214,20 @@ mod test {
214
214
impl Display for InstructionPart < ' _ > {
215
215
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
216
216
match self {
217
- InstructionPart :: Basic ( s) => write ! ( f , "{}" , s) ,
218
- InstructionPart :: Opcode ( s, _o) => write ! ( f, "{} " , s ) ,
219
- InstructionPart :: Arg ( arg) => write ! ( f, "{}" , arg ) ,
220
- InstructionPart :: Separator => write ! ( f , ", " ) ,
217
+ InstructionPart :: Basic ( s) => f . write_str ( s) ,
218
+ InstructionPart :: Opcode ( s, _o) => write ! ( f, "{s } " ) ,
219
+ InstructionPart :: Arg ( arg) => write ! ( f, "{arg}" ) ,
220
+ InstructionPart :: Separator => f . write_str ( ", " ) ,
221
221
}
222
222
}
223
223
}
224
224
225
225
impl Display for InstructionArg < ' _ > {
226
226
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
227
227
match self {
228
- InstructionArg :: Value ( v) => write ! ( f, "{}" , v ) ,
229
- InstructionArg :: BranchDest ( v) => write ! ( f, "{}" , v ) ,
230
- InstructionArg :: Reloc => write ! ( f , "reloc" ) ,
228
+ InstructionArg :: Value ( v) => write ! ( f, "{v}" ) ,
229
+ InstructionArg :: BranchDest ( v) => write ! ( f, "{v}" ) ,
230
+ InstructionArg :: Reloc => f . write_str ( "reloc" ) ,
231
231
}
232
232
}
233
233
}
@@ -264,7 +264,7 @@ mod test {
264
264
)
265
265
. unwrap ( ) ;
266
266
267
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
267
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
268
268
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
269
269
}
270
270
}
@@ -342,7 +342,7 @@ mod test {
342
342
)
343
343
. unwrap ( ) ;
344
344
345
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
345
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
346
346
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
347
347
}
348
348
}
@@ -425,7 +425,7 @@ mod test {
425
425
)
426
426
. unwrap ( ) ;
427
427
428
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
428
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
429
429
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
430
430
}
431
431
}
@@ -462,7 +462,7 @@ mod test {
462
462
)
463
463
. unwrap ( ) ;
464
464
465
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
465
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
466
466
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
467
467
}
468
468
}
@@ -516,7 +516,7 @@ mod test {
516
516
)
517
517
. unwrap ( ) ;
518
518
519
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
519
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
520
520
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
521
521
}
522
522
}
@@ -557,7 +557,7 @@ mod test {
557
557
)
558
558
. unwrap ( ) ;
559
559
560
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
560
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
561
561
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
562
562
}
563
563
}
@@ -601,7 +601,7 @@ mod test {
601
601
)
602
602
. unwrap ( ) ;
603
603
604
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
604
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
605
605
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
606
606
}
607
607
}
@@ -645,7 +645,7 @@ mod test {
645
645
)
646
646
. unwrap ( ) ;
647
647
648
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
648
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
649
649
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
650
650
}
651
651
}
@@ -682,7 +682,7 @@ mod test {
682
682
)
683
683
. unwrap ( ) ;
684
684
685
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
685
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
686
686
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
687
687
}
688
688
}
@@ -716,7 +716,7 @@ mod test {
716
716
)
717
717
. unwrap ( ) ;
718
718
719
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
719
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
720
720
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
721
721
}
722
722
}
@@ -764,7 +764,7 @@ mod test {
764
764
)
765
765
. unwrap ( ) ;
766
766
767
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
767
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
768
768
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
769
769
}
770
770
}
@@ -814,7 +814,7 @@ mod test {
814
814
)
815
815
. unwrap ( ) ;
816
816
817
- let joined_str: String = parts. iter ( ) . map ( |part| format ! ( "{}" , part ) ) . collect ( ) ;
817
+ let joined_str: String = parts. iter ( ) . map ( < _ > :: to_string ) . collect ( ) ;
818
818
assert_eq ! ( joined_str, expected_str. to_string( ) ) ;
819
819
}
820
820
}
0 commit comments