@@ -33,19 +33,17 @@ fn all_ranges<'tcx>(cx: &LateContext<'tcx>, arms: &'tcx [Arm<'_>], ty: Ty<'tcx>)
3333 . filter_map ( |arm| {
3434 if let Arm { pat, guard : None , .. } = * arm {
3535 if let PatKind :: Range ( ref lhs, ref rhs, range_end) = pat. kind {
36- let lhs_const = match lhs {
37- Some ( lhs) => constant ( cx, cx. typeck_results ( ) , lhs) ?,
38- None => {
39- let min_val_const = ty. numeric_min_val ( cx. tcx ) ?;
40- mir_to_const ( cx, mir:: Const :: from_ty_const ( min_val_const, ty, cx. tcx ) ) ?
41- } ,
36+ let lhs_const = if let Some ( lhs) = lhs {
37+ constant ( cx, cx. typeck_results ( ) , lhs) ?
38+ } else {
39+ let min_val_const = ty. numeric_min_val ( cx. tcx ) ?;
40+ mir_to_const ( cx, mir:: Const :: from_ty_const ( min_val_const, ty, cx. tcx ) ) ?
4241 } ;
43- let rhs_const = match rhs {
44- Some ( rhs) => constant ( cx, cx. typeck_results ( ) , rhs) ?,
45- None => {
46- let max_val_const = ty. numeric_max_val ( cx. tcx ) ?;
47- mir_to_const ( cx, mir:: Const :: from_ty_const ( max_val_const, ty, cx. tcx ) ) ?
48- } ,
42+ let rhs_const = if let Some ( rhs) = rhs {
43+ constant ( cx, cx. typeck_results ( ) , rhs) ?
44+ } else {
45+ let max_val_const = ty. numeric_max_val ( cx. tcx ) ?;
46+ mir_to_const ( cx, mir:: Const :: from_ty_const ( max_val_const, ty, cx. tcx ) ) ?
4947 } ;
5048 let lhs_val = lhs_const. int_value ( cx, ty) ?;
5149 let rhs_val = rhs_const. int_value ( cx, ty) ?;
0 commit comments