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