@@ -348,7 +348,7 @@ fn eq_binding_names(s: &Stmt<'_>, names: &[(HirId, Symbol)]) -> bool {
348
348
let mut i = 0usize ;
349
349
let mut res = true ;
350
350
l. pat . each_binding_or_first ( & mut |_, _, _, name| {
351
- if names. get ( i) . map_or ( false , |& ( _, n) | n == name. name ) {
351
+ if names. get ( i) . is_some_and ( |& ( _, n) | n == name. name ) {
352
352
i += 1 ;
353
353
} else {
354
354
res = false ;
@@ -392,12 +392,10 @@ fn eq_stmts(
392
392
let new_bindings = & moved_bindings[ old_count..] ;
393
393
blocks
394
394
. iter ( )
395
- . all ( |b| get_stmt ( b) . map_or ( false , |s| eq_binding_names ( s, new_bindings) ) )
395
+ . all ( |b| get_stmt ( b) . is_some_and ( |s| eq_binding_names ( s, new_bindings) ) )
396
396
} else {
397
397
true
398
- } ) && blocks
399
- . iter ( )
400
- . all ( |b| get_stmt ( b) . map_or ( false , |s| eq. eq_stmt ( s, stmt) ) )
398
+ } ) && blocks. iter ( ) . all ( |b| get_stmt ( b) . is_some_and ( |s| eq. eq_stmt ( s, stmt) ) )
401
399
}
402
400
403
401
#[ expect( clippy:: too_many_lines) ]
@@ -454,9 +452,7 @@ fn scan_block_for_eq<'tcx>(
454
452
// x + 50
455
453
let expr_hash_eq = if let Some ( e) = block. expr {
456
454
let hash = hash_expr ( cx, e) ;
457
- blocks
458
- . iter ( )
459
- . all ( |b| b. expr . map_or ( false , |e| hash_expr ( cx, e) == hash) )
455
+ blocks. iter ( ) . all ( |b| b. expr . is_some_and ( |e| hash_expr ( cx, e) == hash) )
460
456
} else {
461
457
blocks. iter ( ) . all ( |b| b. expr . is_none ( ) )
462
458
} ;
@@ -517,7 +513,7 @@ fn scan_block_for_eq<'tcx>(
517
513
} ) ;
518
514
if let Some ( e) = block. expr {
519
515
for block in blocks {
520
- if block. expr . map_or ( false , |expr| !eq. eq_expr ( expr, e) ) {
516
+ if block. expr . is_some_and ( |expr| !eq. eq_expr ( expr, e) ) {
521
517
moved_locals. truncate ( moved_locals_at_start) ;
522
518
return BlockEq {
523
519
start_end_eq,
@@ -536,7 +532,7 @@ fn scan_block_for_eq<'tcx>(
536
532
}
537
533
538
534
fn check_for_warn_of_moved_symbol ( cx : & LateContext < ' _ > , symbols : & [ ( HirId , Symbol ) ] , if_expr : & Expr < ' _ > ) -> bool {
539
- get_enclosing_block ( cx, if_expr. hir_id ) . map_or ( false , |block| {
535
+ get_enclosing_block ( cx, if_expr. hir_id ) . is_some_and ( |block| {
540
536
let ignore_span = block. span . shrink_to_lo ( ) . to ( if_expr. span ) ;
541
537
542
538
symbols
0 commit comments