@@ -52,7 +52,7 @@ const FLOAT_TYPES_64: [&str; 2] = [
52
52
] ;
53
53
54
54
fn type_len ( t : & str ) -> usize {
55
- let s: Vec < _ > = t. split ( "x" ) . collect ( ) ;
55
+ let s: Vec < _ > = t. split ( 'x' ) . collect ( ) ;
56
56
if s. len ( ) == 2 {
57
57
match & s[ 1 ] [ 0 ..2 ] {
58
58
"1_" => 1 ,
@@ -333,15 +333,15 @@ fn type_to_noq_n_suffix(t: &str) -> &str {
333
333
fn type_to_lane_suffixes < ' a > ( out_t : & ' a str , in_t : & ' a str , re_to_out : bool ) -> String {
334
334
let mut str = String :: new ( ) ;
335
335
let suf = type_to_suffix ( out_t) ;
336
- if !suf. starts_with ( "_" ) {
336
+ if !suf. starts_with ( '_' ) {
337
337
str. push_str ( & suf[ 0 ..1 ] ) ;
338
338
}
339
339
str. push_str ( "_lane" ) ;
340
340
if !re_to_out {
341
341
str. push_str ( type_to_suffix ( in_t) ) ;
342
342
} else {
343
- if type_to_suffix ( in_t) . starts_with ( "q" ) {
344
- str. push_str ( "q" ) ;
343
+ if type_to_suffix ( in_t) . starts_with ( 'q' ) {
344
+ str. push ( 'q' ) ;
345
345
} ;
346
346
let suf2 = type_to_noq_suffix ( out_t) ;
347
347
str. push_str ( suf2) ;
@@ -352,7 +352,7 @@ fn type_to_lane_suffixes<'a>(out_t: &'a str, in_t: &'a str, re_to_out: bool) ->
352
352
fn type_to_rot_suffix ( c_name : & str , suf : & str ) -> String {
353
353
let ns: Vec < _ > = c_name. split ( '_' ) . collect ( ) ;
354
354
assert_eq ! ( ns. len( ) , 2 ) ;
355
- if let Some ( suf) = suf. strip_prefix ( "q" ) {
355
+ if let Some ( suf) = suf. strip_prefix ( 'q' ) {
356
356
format ! ( "{}q_{}{}" , ns[ 0 ] , ns[ 1 ] , suf)
357
357
} else {
358
358
format ! ( "{c_name}{suf}" )
@@ -377,10 +377,10 @@ fn type_to_unsigned(t: &str) -> String {
377
377
fn type_to_double_suffixes < ' a > ( out_t : & ' a str , in_t : & ' a str ) -> String {
378
378
let mut str = String :: new ( ) ;
379
379
let suf = type_to_suffix ( in_t) ;
380
- if suf. starts_with ( "q" ) && type_to_suffix ( out_t) . starts_with ( "q" ) {
381
- str. push_str ( "q" ) ;
380
+ if suf. starts_with ( 'q' ) && type_to_suffix ( out_t) . starts_with ( 'q' ) {
381
+ str. push ( 'q' ) ;
382
382
}
383
- if !suf. starts_with ( "_" ) && !suf. starts_with ( "q" ) {
383
+ if !suf. starts_with ( '_' ) && !suf. starts_with ( 'q' ) {
384
384
str. push_str ( & suf[ 0 ..1 ] ) ;
385
385
}
386
386
str. push_str ( type_to_noq_suffix ( out_t) ) ;
@@ -391,10 +391,10 @@ fn type_to_double_suffixes<'a>(out_t: &'a str, in_t: &'a str) -> String {
391
391
fn type_to_double_n_suffixes < ' a > ( out_t : & ' a str , in_t : & ' a str ) -> String {
392
392
let mut str = String :: new ( ) ;
393
393
let suf = type_to_suffix ( in_t) ;
394
- if suf. starts_with ( "q" ) && type_to_suffix ( out_t) . starts_with ( "q" ) {
395
- str. push_str ( "q" ) ;
394
+ if suf. starts_with ( 'q' ) && type_to_suffix ( out_t) . starts_with ( 'q' ) {
395
+ str. push ( 'q' ) ;
396
396
}
397
- if !suf. starts_with ( "_" ) && !suf. starts_with ( "q" ) {
397
+ if !suf. starts_with ( '_' ) && !suf. starts_with ( 'q' ) {
398
398
str. push_str ( & suf[ 0 ..1 ] ) ;
399
399
}
400
400
str. push_str ( "_n" ) ;
@@ -579,8 +579,8 @@ impl TargetFeature {
579
579
580
580
/// Generate target_feature attributes for a test that will compile for both "arm" and "aarch64".
581
581
fn to_target_feature_attr_shared ( & self ) -> Lines {
582
- let arm = self . as_target_feature_arg_arm ( ) . split ( "," ) ;
583
- let aarch64 = self . as_target_feature_arg_aarch64 ( ) . split ( "," ) ;
582
+ let arm = self . as_target_feature_arg_arm ( ) . split ( ',' ) ;
583
+ let aarch64 = self . as_target_feature_arg_aarch64 ( ) . split ( ',' ) ;
584
584
585
585
// Combine common features into an unconditional `target_feature` annotation, but guard
586
586
// others behind `cfg_attr`.
@@ -1170,7 +1170,7 @@ fn map_val<'v>(t: &str, v: &'v str) -> &'v str {
1170
1170
1171
1171
fn type_to_ext ( t : & str , v : bool , r : bool , pi8 : bool ) -> String {
1172
1172
if !t. contains ( 'x' ) {
1173
- return t. replace ( "u" , "i" ) ;
1173
+ return t. replace ( 'u' , "i" ) ;
1174
1174
}
1175
1175
let native = type_to_native_type ( t) ;
1176
1176
let sub_ext = match type_sub_len ( t) {
@@ -1185,7 +1185,7 @@ fn type_to_ext(t: &str, v: bool, r: bool, pi8: bool) -> String {
1185
1185
} ;
1186
1186
let sub_type = match & native[ 0 ..1 ] {
1187
1187
"i" | "f" => native,
1188
- "u" => native. replace ( "u" , "i" ) ,
1188
+ "u" => native. replace ( 'u' , "i" ) ,
1189
1189
_ => panic ! ( "unknown type: {t}" ) ,
1190
1190
} ;
1191
1191
let ext = format ! (
@@ -1222,15 +1222,15 @@ fn is_vldx(name: &str) -> bool {
1222
1222
let s: Vec < _ > = name. split ( '_' ) . collect ( ) ;
1223
1223
& name[ 0 ..3 ] == "vld"
1224
1224
&& name[ 3 ..4 ] . parse :: < i32 > ( ) . unwrap ( ) > 1
1225
- && ( s. last ( ) . unwrap ( ) . starts_with ( "s" ) || s. last ( ) . unwrap ( ) . starts_with ( "f" ) )
1225
+ && ( s. last ( ) . unwrap ( ) . starts_with ( 's' ) || s. last ( ) . unwrap ( ) . starts_with ( 'f' ) )
1226
1226
}
1227
1227
1228
1228
fn is_vstx ( name : & str ) -> bool {
1229
1229
let s: Vec < _ > = name. split ( '_' ) . collect ( ) ;
1230
1230
s. len ( ) == 2
1231
1231
&& & name[ 0 ..3 ] == "vst"
1232
1232
&& name[ 3 ..4 ] . parse :: < i32 > ( ) . unwrap ( ) > 1
1233
- && ( s[ 1 ] . starts_with ( "s" ) || s[ 1 ] . starts_with ( "f" ) )
1233
+ && ( s[ 1 ] . starts_with ( 's' ) || s[ 1 ] . starts_with ( 'f' ) )
1234
1234
}
1235
1235
1236
1236
fn create_doc_string ( comment_string : & str , fn_name : & str ) -> String {
@@ -1358,7 +1358,7 @@ fn gen_aarch64(
1358
1358
] ;
1359
1359
let mut ext_c = String :: new ( ) ;
1360
1360
if let Some ( mut link_aarch64) = link_aarch64. clone ( ) {
1361
- if link_aarch64. contains ( ":" ) {
1361
+ if link_aarch64. contains ( ':' ) {
1362
1362
let links: Vec < _ > = link_aarch64. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
1363
1363
assert_eq ! ( links. len( ) , 5 ) ;
1364
1364
link_aarch64 = links[ 0 ] . to_string ( ) ;
@@ -1461,7 +1461,7 @@ fn gen_aarch64(
1461
1461
) ;
1462
1462
} ;
1463
1463
let const_declare = if let Some ( constn) = constn {
1464
- if constn. contains ( ":" ) {
1464
+ if constn. contains ( ':' ) {
1465
1465
let constns: Vec < _ > = constn. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
1466
1466
assert_eq ! ( constns. len( ) , 2 ) ;
1467
1467
format ! ( r#"<const {}: i32, const {}: i32>"# , constns[ 0 ] , constns[ 1 ] )
@@ -1492,7 +1492,7 @@ fn gen_aarch64(
1492
1492
String :: new ( )
1493
1493
} ;
1494
1494
let const_assert = if let Some ( constn) = constn {
1495
- if constn. contains ( ":" ) {
1495
+ if constn. contains ( ':' ) {
1496
1496
let constns: Vec < _ > = constn. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
1497
1497
let const_test = current_tests[ 0 ] . 3 . as_ref ( ) . unwrap ( ) ;
1498
1498
let const_tests: Vec < _ > = const_test. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
@@ -1516,7 +1516,7 @@ fn gen_aarch64(
1516
1516
String :: new ( )
1517
1517
} ;
1518
1518
let const_legacy = if let Some ( constn) = constn {
1519
- if constn. contains ( ":" ) {
1519
+ if constn. contains ( ':' ) {
1520
1520
format ! (
1521
1521
"\n #[rustc_legacy_const_generics({}, {})]" ,
1522
1522
para_num - 1 ,
@@ -1839,7 +1839,7 @@ fn gen_test(
1839
1839
let c: Vec < String > = c. iter ( ) . take ( len_in[ 2 ] ) . cloned ( ) . collect ( ) ;
1840
1840
let e: Vec < String > = e. iter ( ) . take ( len_out) . cloned ( ) . collect ( ) ;
1841
1841
let const_value = if let Some ( constn) = n {
1842
- if constn. contains ( ":" ) {
1842
+ if constn. contains ( ':' ) {
1843
1843
let constns: Vec < _ > = constn. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
1844
1844
format ! (
1845
1845
r#"::<{}, {}>"# ,
@@ -2046,7 +2046,7 @@ fn gen_arm(
2046
2046
out_t. to_string( ) ,
2047
2047
] ;
2048
2048
if let ( Some ( mut link_arm) , Some ( mut link_aarch64) ) = ( link_arm. clone ( ) , link_aarch64. clone ( ) ) {
2049
- if link_arm. contains ( ":" ) {
2049
+ if link_arm. contains ( ':' ) {
2050
2050
let links: Vec < _ > = link_arm. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
2051
2051
assert_eq ! ( links. len( ) , 5 ) ;
2052
2052
link_arm = links[ 0 ] . to_string ( ) ;
@@ -2057,7 +2057,7 @@ fn gen_arm(
2057
2057
links[ 4 ] . clone( ) ,
2058
2058
] ;
2059
2059
}
2060
- if link_aarch64. contains ( ":" ) {
2060
+ if link_aarch64. contains ( ':' ) {
2061
2061
let links: Vec < _ > = link_aarch64. split ( ':' ) . map ( |v| v. to_string ( ) ) . collect ( ) ;
2062
2062
assert_eq ! ( links. len( ) , 5 ) ;
2063
2063
link_aarch64 = links[ 0 ] . to_string ( ) ;
@@ -2129,7 +2129,7 @@ fn gen_arm(
2129
2129
} ;
2130
2130
( format ! ( "ptr: {ptr_type}, {inputs}, n: i32, size: i32" ) , out)
2131
2131
} else {
2132
- let ( _, const_type) = if const_arm. contains ( ":" ) {
2132
+ let ( _, const_type) = if const_arm. contains ( ':' ) {
2133
2133
let consts: Vec < _ > =
2134
2134
const_arm. split ( ':' ) . map ( |v| v. trim ( ) . to_string ( ) ) . collect ( ) ;
2135
2135
( consts[ 0 ] . clone ( ) , consts[ 1 ] . clone ( ) )
@@ -3142,8 +3142,8 @@ fn get_call(
3142
3142
if fn_format[ 2 ] == "ext" {
3143
3143
fn_name. push_str ( "_" ) ;
3144
3144
} else if fn_format[ 2 ] == "noext" {
3145
- } else if fn_format[ 2 ] . starts_with ( "<" ) {
3146
- assert ! ( fn_format[ 2 ] . ends_with( ">" ) ) ;
3145
+ } else if fn_format[ 2 ] . starts_with ( '<' ) {
3146
+ assert ! ( fn_format[ 2 ] . ends_with( '>' ) ) ;
3147
3147
let types: Vec < _ > = fn_format[ 2 ] [ 1 ..fn_format[ 2 ] . len ( ) - 1 ]
3148
3148
. split ( ' ' )
3149
3149
. map ( |v| v. to_string ( ) )
@@ -3172,7 +3172,7 @@ fn get_call(
3172
3172
r#"let {}: {} = {}({});"# ,
3173
3173
re_name, re_type, fn_name, param_str
3174
3174
)
3175
- } else if fn_name. starts_with ( "*" ) {
3175
+ } else if fn_name. starts_with ( '*' ) {
3176
3176
format ! ( r#"{fn_name} = {param_str};"# )
3177
3177
} else {
3178
3178
format ! ( r#"{fn_name}({param_str})"# )
0 commit comments