@@ -9,7 +9,7 @@ use clippy_utils::ty::{implements_trait, is_type_diagnostic_item, match_type, pe
99use clippy_utils:: visitors:: is_local_used;
1010use clippy_utils:: {
1111 get_parent_expr, is_expn_of, is_lang_ctor, is_lint_allowed, is_refutable, is_unit_expr, is_wild, meets_msrv, msrvs,
12- path_to_local, path_to_local_id, peel_hir_pat_refs, peel_n_hir_expr_refs, recurse_or_patterns, remove_blocks ,
12+ path_to_local, path_to_local_id, peel_blocks , peel_hir_pat_refs, peel_n_hir_expr_refs, recurse_or_patterns,
1313 strip_pat_refs,
1414} ;
1515use clippy_utils:: { paths, search_same, SpanlessEq , SpanlessHash } ;
@@ -659,7 +659,7 @@ impl<'tcx> LateLintPass<'tcx> for Matches {
659659 QPath :: Resolved ( None , variant_name) , args, _) = arms[ 0 ] . pat. kind;
660660 if args. len( ) == 1 ;
661661 if let PatKind :: Binding ( _, arg, ..) = strip_pat_refs( & args[ 0 ] ) . kind;
662- let body = remove_blocks ( arms[ 0 ] . body) ;
662+ let body = peel_blocks ( arms[ 0 ] . body) ;
663663 if path_to_local_id( body, arg) ;
664664
665665 then {
@@ -724,7 +724,7 @@ fn check_single_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], exp
724724 return ;
725725 }
726726 let els = arms[ 1 ] . body ;
727- let els = if is_unit_expr ( remove_blocks ( els) ) {
727+ let els = if is_unit_expr ( peel_blocks ( els) ) {
728728 None
729729 } else if let ExprKind :: Block ( Block { stmts, expr : block_expr, .. } , _) = els. kind {
730730 if stmts. len ( ) == 1 && block_expr. is_none ( ) || stmts. is_empty ( ) && block_expr. is_some ( ) {
@@ -1482,7 +1482,7 @@ fn check_match_single_binding<'a>(cx: &LateContext<'a>, ex: &Expr<'a>, arms: &[A
14821482
14831483 let matched_vars = ex. span ;
14841484 let bind_names = arms[ 0 ] . pat . span ;
1485- let match_body = remove_blocks ( arms[ 0 ] . body ) ;
1485+ let match_body = peel_blocks ( arms[ 0 ] . body ) ;
14861486 let mut snippet_body = if match_body. span . from_expansion ( ) {
14871487 Sugg :: hir_with_macro_callsite ( cx, match_body, ".." ) . to_string ( )
14881488 } else {
@@ -1679,7 +1679,7 @@ fn is_ref_some_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> Option<BindingAnnotat
16791679 if is_lang_ctor( cx, qpath, OptionSome ) ;
16801680 if let PatKind :: Binding ( rb, .., ident, _) = first_pat. kind;
16811681 if rb == BindingAnnotation :: Ref || rb == BindingAnnotation :: RefMut ;
1682- if let ExprKind :: Call ( e, args) = remove_blocks ( arm. body) . kind;
1682+ if let ExprKind :: Call ( e, args) = peel_blocks ( arm. body) . kind;
16831683 if let ExprKind :: Path ( ref some_path) = e. kind;
16841684 if is_lang_ctor( cx, some_path, OptionSome ) && args. len( ) == 1 ;
16851685 if let ExprKind :: Path ( QPath :: Resolved ( _, path2) ) = args[ 0 ] . kind;
0 commit comments