@@ -1069,29 +1069,30 @@ fn build_manual_memcpy_suggestion<'tcx>(
1069
1069
}
1070
1070
}
1071
1071
1072
- let print_limit = |end : & Expr < ' _ > , end_str : & str , base : & Expr < ' _ > , sugg : MinifyingSugg < ' static > | -> MinifyingSugg < ' static > {
1073
- if_chain ! {
1074
- if let ExprKind :: MethodCall ( method, _, len_args, _) = end. kind;
1075
- if method. ident. name == sym!( len) ;
1076
- if len_args. len( ) == 1 ;
1077
- if let Some ( arg) = len_args. get( 0 ) ;
1078
- if var_def_id( cx, arg) == var_def_id( cx, base) ;
1079
- then {
1080
- if sugg. as_str( ) == end_str {
1081
- MinifyingSugg :: non_paren( "" )
1072
+ let print_limit =
1073
+ |end : & Expr < ' _ > , end_str : & str , base : & Expr < ' _ > , sugg : MinifyingSugg < ' static > | -> MinifyingSugg < ' static > {
1074
+ if_chain ! {
1075
+ if let ExprKind :: MethodCall ( method, _, len_args, _) = end. kind;
1076
+ if method. ident. name == sym!( len) ;
1077
+ if len_args. len( ) == 1 ;
1078
+ if let Some ( arg) = len_args. get( 0 ) ;
1079
+ if var_def_id( cx, arg) == var_def_id( cx, base) ;
1080
+ then {
1081
+ if sugg. as_str( ) == end_str {
1082
+ MinifyingSugg :: non_paren( "" )
1083
+ } else {
1084
+ sugg
1085
+ }
1082
1086
} else {
1083
- sugg
1084
- }
1085
- } else {
1086
- match limits {
1087
- ast:: RangeLimits :: Closed => {
1088
- sugg + & MinifyingSugg :: non_paren( "1" )
1089
- } ,
1090
- ast:: RangeLimits :: HalfOpen => sugg,
1087
+ match limits {
1088
+ ast:: RangeLimits :: Closed => {
1089
+ sugg + & MinifyingSugg :: non_paren( "1" )
1090
+ } ,
1091
+ ast:: RangeLimits :: HalfOpen => sugg,
1092
+ }
1091
1093
}
1092
1094
}
1093
- }
1094
- } ;
1095
+ } ;
1095
1096
1096
1097
let start_str = MinifyingSugg :: hir ( cx, start, "" ) ;
1097
1098
let end_str = MinifyingSugg :: hir ( cx, end, "" ) ;
0 commit comments