@@ -1111,8 +1111,7 @@ fn lint_or_fun_call<'a, 'tcx: 'a>(
1111
1111
1112
1112
if [ "default" , "new" ] . contains ( & path) {
1113
1113
let arg_ty = cx. tables . expr_ty ( arg) ;
1114
- let default_trait_id = if let Some ( default_trait_id) = get_trait_def_id ( cx, & paths:: DEFAULT_TRAIT )
1115
- {
1114
+ let default_trait_id = if let Some ( default_trait_id) = get_trait_def_id ( cx, & paths:: DEFAULT_TRAIT ) {
1116
1115
default_trait_id
1117
1116
} else {
1118
1117
return false ;
@@ -2254,33 +2253,15 @@ fn lint_chars_cmp_with_unwrap<'a, 'tcx>(
2254
2253
2255
2254
/// Checks for the `CHARS_NEXT_CMP` lint with `unwrap()`.
2256
2255
fn lint_chars_next_cmp_with_unwrap < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , info : & BinaryExprInfo < ' _ > ) -> bool {
2257
- lint_chars_cmp_with_unwrap (
2258
- cx,
2259
- info,
2260
- & [ "chars" , "next" , "unwrap" ] ,
2261
- CHARS_NEXT_CMP ,
2262
- "starts_with" ,
2263
- )
2256
+ lint_chars_cmp_with_unwrap ( cx, info, & [ "chars" , "next" , "unwrap" ] , CHARS_NEXT_CMP , "starts_with" )
2264
2257
}
2265
2258
2266
2259
/// Checks for the `CHARS_LAST_CMP` lint with `unwrap()`.
2267
2260
fn lint_chars_last_cmp_with_unwrap < ' a , ' tcx > ( cx : & LateContext < ' a , ' tcx > , info : & BinaryExprInfo < ' _ > ) -> bool {
2268
- if lint_chars_cmp_with_unwrap (
2269
- cx,
2270
- info,
2271
- & [ "chars" , "last" , "unwrap" ] ,
2272
- CHARS_LAST_CMP ,
2273
- "ends_with" ,
2274
- ) {
2261
+ if lint_chars_cmp_with_unwrap ( cx, info, & [ "chars" , "last" , "unwrap" ] , CHARS_LAST_CMP , "ends_with" ) {
2275
2262
true
2276
2263
} else {
2277
- lint_chars_cmp_with_unwrap (
2278
- cx,
2279
- info,
2280
- & [ "chars" , "next_back" , "unwrap" ] ,
2281
- CHARS_LAST_CMP ,
2282
- "ends_with" ,
2283
- )
2264
+ lint_chars_cmp_with_unwrap ( cx, info, & [ "chars" , "next_back" , "unwrap" ] , CHARS_LAST_CMP , "ends_with" )
2284
2265
}
2285
2266
}
2286
2267
@@ -2344,7 +2325,10 @@ fn lint_asref(cx: &LateContext<'_, '_>, expr: &hir::Expr, call_name: &str, as_re
2344
2325
}
2345
2326
}
2346
2327
2347
- fn ty_has_iter_method ( cx : & LateContext < ' _ , ' _ > , self_ref_ty : Ty < ' _ > ) -> Option < ( & ' static Lint , & ' static str , & ' static str ) > {
2328
+ fn ty_has_iter_method (
2329
+ cx : & LateContext < ' _ , ' _ > ,
2330
+ self_ref_ty : Ty < ' _ > ,
2331
+ ) -> Option < ( & ' static Lint , & ' static str , & ' static str ) > {
2348
2332
if let Some ( ty_name) = has_iter_method ( cx, self_ref_ty) {
2349
2333
let lint = if ty_name == "array" || ty_name == "PathBuf" {
2350
2334
INTO_ITER_ON_ARRAY
0 commit comments