@@ -69,7 +69,7 @@ fn do_ctest() {
69
69
t if t. contains ( "windows" ) => return test_windows ( t) ,
70
70
t if t. contains ( "vxworks" ) => return test_vxworks ( t) ,
71
71
t if t. contains ( "nto-qnx" ) => return test_neutrino ( t) ,
72
- t => panic ! ( "unknown target {}" , t ) ,
72
+ t => panic ! ( "unknown target {t}" ) ,
73
73
}
74
74
}
75
75
@@ -109,13 +109,13 @@ fn do_semver() {
109
109
process_semver_file ( & mut output, & mut semver_root, & vendor) ;
110
110
}
111
111
process_semver_file ( & mut output, & mut semver_root, & os) ;
112
- let os_arch = format ! ( "{}-{}" , os , arch ) ;
112
+ let os_arch = format ! ( "{os }-{arch}" ) ;
113
113
process_semver_file ( & mut output, & mut semver_root, & os_arch) ;
114
114
if target_env != "" {
115
- let os_env = format ! ( "{}-{}" , os , target_env ) ;
115
+ let os_env = format ! ( "{os }-{target_env}" ) ;
116
116
process_semver_file ( & mut output, & mut semver_root, & os_env) ;
117
117
118
- let os_env_arch = format ! ( "{}-{}-{}" , os , target_env , arch ) ;
118
+ let os_env_arch = format ! ( "{os }-{target_env }-{arch}" ) ;
119
119
process_semver_file ( & mut output, & mut semver_root, & os_env_arch) ;
120
120
}
121
121
}
@@ -132,7 +132,7 @@ fn process_semver_file<W: Write, P: AsRef<Path>>(output: &mut W, path: &mut Path
132
132
path. pop ( ) ;
133
133
return ;
134
134
}
135
- Err ( err) => panic ! ( "unexpected error opening file: {}" , err ) ,
135
+ Err ( err) => panic ! ( "unexpected error opening file: {err}" ) ,
136
136
} ;
137
137
let input = BufReader :: new ( input_file) ;
138
138
@@ -471,9 +471,9 @@ fn test_apple(target: &str) {
471
471
// OSX calls this something else
472
472
"sighandler_t" => "sig_t" . to_string ( ) ,
473
473
474
- t if is_union => format ! ( "union {}" , t ) ,
474
+ t if is_union => format ! ( "union {t}" ) ,
475
475
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
476
- t if is_struct => format ! ( "struct {}" , t ) ,
476
+ t if is_struct => format ! ( "struct {t}" ) ,
477
477
t => t. to_string ( ) ,
478
478
}
479
479
} ) ;
@@ -654,9 +654,9 @@ fn test_openbsd(target: &str) {
654
654
// OSX calls this something else
655
655
"sighandler_t" => "sig_t" . to_string ( ) ,
656
656
657
- t if is_union => format ! ( "union {}" , t ) ,
657
+ t if is_union => format ! ( "union {t}" ) ,
658
658
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
659
- t if is_struct => format ! ( "struct {}" , t ) ,
659
+ t if is_struct => format ! ( "struct {t}" ) ,
660
660
t => t. to_string ( ) ,
661
661
}
662
662
} ) ;
@@ -753,15 +753,15 @@ fn test_cygwin(target: &str) {
753
753
754
754
"Ioctl" => "int" . to_string ( ) ,
755
755
756
- t if is_union => format ! ( "union {}" , t ) ,
756
+ t if is_union => format ! ( "union {t}" ) ,
757
757
758
758
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
759
759
760
760
// sigval is a struct in Rust, but a union in C:
761
761
"sigval" => format ! ( "union sigval" ) ,
762
762
763
763
// put `struct` in front of all structs:.
764
- t if is_struct => format ! ( "struct {}" , t ) ,
764
+ t if is_struct => format ! ( "struct {t}" ) ,
765
765
766
766
t => t. to_string ( ) ,
767
767
}
@@ -905,7 +905,7 @@ fn test_windows(target: &str) {
905
905
"sighandler_t" if !gnu => "_crt_signal_t" . to_string ( ) ,
906
906
"sighandler_t" if gnu => "__p_sig_fn_t" . to_string ( ) ,
907
907
908
- t if is_union => format ! ( "union {}" , t ) ,
908
+ t if is_union => format ! ( "union {t}" ) ,
909
909
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
910
910
911
911
// Windows uppercase structs don't have `struct` in front:
@@ -918,7 +918,7 @@ fn test_windows(target: &str) {
918
918
"struct __utimbuf64" . to_string ( )
919
919
} else {
920
920
// put `struct` in front of all structs:
921
- format ! ( "struct {}" , t )
921
+ format ! ( "struct {t}" )
922
922
}
923
923
}
924
924
t => t. to_string ( ) ,
@@ -1164,8 +1164,8 @@ fn test_solarish(target: &str) {
1164
1164
"FILE" => "__FILE" . to_string ( ) ,
1165
1165
"DIR" | "Dl_info" => ty. to_string ( ) ,
1166
1166
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
1167
- t if is_struct => format ! ( "struct {}" , t ) ,
1168
- t if is_union => format ! ( "union {}" , t ) ,
1167
+ t if is_struct => format ! ( "struct {t}" ) ,
1168
+ t if is_union => format ! ( "union {t}" ) ,
1169
1169
t => t. to_string ( ) ,
1170
1170
} ) ;
1171
1171
@@ -1434,12 +1434,12 @@ fn test_netbsd(target: &str) {
1434
1434
// OSX calls this something else
1435
1435
"sighandler_t" => "sig_t" . to_string ( ) ,
1436
1436
1437
- t if is_union => format ! ( "union {}" , t ) ,
1437
+ t if is_union => format ! ( "union {t}" ) ,
1438
1438
1439
1439
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
1440
1440
1441
1441
// put `struct` in front of all structs:.
1442
- t if is_struct => format ! ( "struct {}" , t ) ,
1442
+ t if is_struct => format ! ( "struct {t}" ) ,
1443
1443
1444
1444
t => t. to_string ( ) ,
1445
1445
}
@@ -1650,15 +1650,15 @@ fn test_dragonflybsd(target: &str) {
1650
1650
// FIXME(dragonflybsd): OSX calls this something else
1651
1651
"sighandler_t" => "sig_t" . to_string ( ) ,
1652
1652
1653
- t if is_union => format ! ( "union {}" , t ) ,
1653
+ t if is_union => format ! ( "union {t}" ) ,
1654
1654
1655
1655
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
1656
1656
1657
1657
// sigval is a struct in Rust, but a union in C:
1658
1658
"sigval" => format ! ( "union sigval" ) ,
1659
1659
1660
1660
// put `struct` in front of all structs:.
1661
- t if is_struct => format ! ( "struct {}" , t ) ,
1661
+ t if is_struct => format ! ( "struct {t}" ) ,
1662
1662
1663
1663
t => t. to_string ( ) ,
1664
1664
}
@@ -1828,11 +1828,11 @@ fn test_wasi(target: &str) {
1828
1828
1829
1829
cfg. type_name ( move |ty, is_struct, is_union| match ty {
1830
1830
"FILE" | "fd_set" | "DIR" => ty. to_string ( ) ,
1831
- t if is_union => format ! ( "union {}" , t ) ,
1832
- t if t. starts_with ( "__wasi" ) && t. ends_with ( "_u" ) => format ! ( "union {}" , t ) ,
1833
- t if t. starts_with ( "__wasi" ) && is_struct => format ! ( "struct {}" , t ) ,
1831
+ t if is_union => format ! ( "union {t}" ) ,
1832
+ t if t. starts_with ( "__wasi" ) && t. ends_with ( "_u" ) => format ! ( "union {t}" ) ,
1833
+ t if t. starts_with ( "__wasi" ) && is_struct => format ! ( "struct {t}" ) ,
1834
1834
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
1835
- t if is_struct => format ! ( "struct {}" , t ) ,
1835
+ t if is_struct => format ! ( "struct {t}" ) ,
1836
1836
t => t. to_string ( ) ,
1837
1837
} ) ;
1838
1838
@@ -1881,7 +1881,7 @@ fn test_android(target: &str) {
1881
1881
let target_pointer_width = match target {
1882
1882
t if t. contains ( "aarch64" ) || t. contains ( "x86_64" ) => 64 ,
1883
1883
t if t. contains ( "i686" ) || t. contains ( "arm" ) => 32 ,
1884
- t => panic ! ( "unsupported target: {}" , t ) ,
1884
+ t => panic ! ( "unsupported target: {t}" ) ,
1885
1885
} ;
1886
1886
let x86 = target. contains ( "i686" ) || target. contains ( "x86_64" ) ;
1887
1887
let aarch64 = target. contains ( "aarch64" ) ;
@@ -2040,15 +2040,15 @@ fn test_android(target: &str) {
2040
2040
// Just pass all these through, no need for a "struct" prefix
2041
2041
"FILE" | "fd_set" | "Dl_info" | "Elf32_Phdr" | "Elf64_Phdr" => ty. to_string ( ) ,
2042
2042
2043
- t if is_union => format ! ( "union {}" , t ) ,
2043
+ t if is_union => format ! ( "union {t}" ) ,
2044
2044
2045
2045
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
2046
2046
2047
2047
// sigval is a struct in Rust, but a union in C:
2048
2048
"sigval" => format ! ( "union sigval" ) ,
2049
2049
2050
2050
// put `struct` in front of all structs:.
2051
- t if is_struct => format ! ( "struct {}" , t ) ,
2051
+ t if is_struct => format ! ( "struct {t}" ) ,
2052
2052
2053
2053
t => t. to_string ( ) ,
2054
2054
}
@@ -2553,15 +2553,15 @@ fn test_freebsd(target: &str) {
2553
2553
// FIXME(freebsd): https://github.com/rust-lang/libc/issues/1273
2554
2554
"sighandler_t" => "sig_t" . to_string ( ) ,
2555
2555
2556
- t if is_union => format ! ( "union {}" , t ) ,
2556
+ t if is_union => format ! ( "union {t}" ) ,
2557
2557
2558
2558
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
2559
2559
2560
2560
// sigval is a struct in Rust, but a union in C:
2561
2561
"sigval" => format ! ( "union sigval" ) ,
2562
2562
2563
2563
// put `struct` in front of all structs:.
2564
- t if is_struct => format ! ( "struct {}" , t ) ,
2564
+ t if is_struct => format ! ( "struct {t}" ) ,
2565
2565
2566
2566
t => t. to_string ( ) ,
2567
2567
}
@@ -3158,10 +3158,10 @@ fn test_emscripten(target: &str) {
3158
3158
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3159
3159
3160
3160
// put `struct` in front of all structs:.
3161
- t if is_struct => format ! ( "struct {}" , t ) ,
3161
+ t if is_struct => format ! ( "struct {t}" ) ,
3162
3162
3163
3163
// put `union` in front of all unions:
3164
- t if is_union => format ! ( "union {}" , t ) ,
3164
+ t if is_union => format ! ( "union {t}" ) ,
3165
3165
3166
3166
t => t. to_string ( ) ,
3167
3167
}
@@ -3438,12 +3438,12 @@ fn test_neutrino(target: &str) {
3438
3438
3439
3439
"Ioctl" => "int" . to_string ( ) ,
3440
3440
3441
- t if is_union => format ! ( "union {}" , t ) ,
3441
+ t if is_union => format ! ( "union {t}" ) ,
3442
3442
3443
3443
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3444
3444
3445
3445
// put `struct` in front of all structs:.
3446
- t if is_struct => format ! ( "struct {}" , t ) ,
3446
+ t if is_struct => format ! ( "struct {t}" ) ,
3447
3447
3448
3448
t => t. to_string ( ) ,
3449
3449
}
@@ -3664,9 +3664,9 @@ fn test_vxworks(target: &str) {
3664
3664
3665
3665
cfg. type_name ( move |ty, is_struct, is_union| match ty {
3666
3666
"DIR" | "FILE" | "Dl_info" | "RTP_DESC" => ty. to_string ( ) ,
3667
- t if is_union => format ! ( "union {}" , t ) ,
3667
+ t if is_union => format ! ( "union {t}" ) ,
3668
3668
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3669
- t if is_struct => format ! ( "struct {}" , t ) ,
3669
+ t if is_struct => format ! ( "struct {t}" ) ,
3670
3670
t => t. to_string ( ) ,
3671
3671
} ) ;
3672
3672
@@ -3716,10 +3716,7 @@ fn test_linux(target: &str) {
3716
3716
( true , false , false ) => ( ) ,
3717
3717
( false , true , false ) => ( ) ,
3718
3718
( false , false , true ) => ( ) ,
3719
- ( _, _, _) => panic ! (
3720
- "linux target lib is gnu: {}, musl: {}, uclibc: {}" ,
3721
- gnu, musl, uclibc
3722
- ) ,
3719
+ ( _, _, _) => panic ! ( "linux target lib is gnu: {gnu}, musl: {musl}, uclibc: {uclibc}" ) ,
3723
3720
}
3724
3721
3725
3722
let arm = target. contains ( "arm" ) ;
@@ -3959,9 +3956,9 @@ fn test_linux(target: &str) {
3959
3956
// typedefs don't need any keywords
3960
3957
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
3961
3958
// put `struct` in front of all structs:.
3962
- t if is_struct => format ! ( "struct {}" , t ) ,
3959
+ t if is_struct => format ! ( "struct {t}" ) ,
3963
3960
// put `union` in front of all unions:
3964
- t if is_union => format ! ( "union {}" , t ) ,
3961
+ t if is_union => format ! ( "union {t}" ) ,
3965
3962
3966
3963
t => t. to_string ( ) ,
3967
3964
}
@@ -4990,8 +4987,8 @@ fn test_linux_like_apis(target: &str) {
4990
4987
_ => true ,
4991
4988
} )
4992
4989
. type_name ( move |ty, is_struct, is_union| match ty {
4993
- t if is_struct => format ! ( "struct {}" , t ) ,
4994
- t if is_union => format ! ( "union {}" , t ) ,
4990
+ t if is_struct => format ! ( "struct {t}" ) ,
4991
+ t if is_union => format ! ( "union {t}" ) ,
4995
4992
t => t. to_string ( ) ,
4996
4993
} ) ;
4997
4994
@@ -5016,8 +5013,8 @@ fn test_linux_like_apis(target: &str) {
5016
5013
. type_name ( move |ty, is_struct, is_union| match ty {
5017
5014
"Ioctl" if gnu => "unsigned long" . to_string ( ) ,
5018
5015
"Ioctl" => "int" . to_string ( ) ,
5019
- t if is_struct => format ! ( "struct {}" , t ) ,
5020
- t if is_union => format ! ( "union {}" , t ) ,
5016
+ t if is_struct => format ! ( "struct {t}" ) ,
5017
+ t if is_union => format ! ( "union {t}" ) ,
5021
5018
t => t. to_string ( ) ,
5022
5019
} ) ;
5023
5020
cfg. generate ( src_hotfix_dir ( ) . join ( "lib.rs" ) , "linux_termios.rs" ) ;
@@ -5045,8 +5042,8 @@ fn test_linux_like_apis(target: &str) {
5045
5042
_ => true ,
5046
5043
} )
5047
5044
. type_name ( move |ty, is_struct, is_union| match ty {
5048
- t if is_struct => format ! ( "struct {}" , t ) ,
5049
- t if is_union => format ! ( "union {}" , t ) ,
5045
+ t if is_struct => format ! ( "struct {t}" ) ,
5046
+ t if is_union => format ! ( "union {t}" ) ,
5050
5047
t => t. to_string ( ) ,
5051
5048
} ) ;
5052
5049
cfg. generate ( src_hotfix_dir ( ) . join ( "lib.rs" ) , "linux_ipv6.rs" ) ;
@@ -5433,9 +5430,9 @@ fn test_haiku(target: &str) {
5433
5430
5434
5431
// is actually a union
5435
5432
"sigval" => format ! ( "union sigval" ) ,
5436
- t if is_union => format ! ( "union {}" , t ) ,
5433
+ t if is_union => format ! ( "union {t}" ) ,
5437
5434
t if t. ends_with ( "_t" ) => t. to_string ( ) ,
5438
- t if is_struct => format ! ( "struct {}" , t ) ,
5435
+ t if is_struct => format ! ( "struct {t}" ) ,
5439
5436
t => t. to_string ( ) ,
5440
5437
}
5441
5438
} ) ;
0 commit comments