@@ -826,7 +826,7 @@ struct FixedOffsetVar<'hir> {
826
826
}
827
827
828
828
fn is_slice_like < ' tcx > ( cx : & LateContext < ' tcx > , ty : Ty < ' _ > ) -> bool {
829
- let is_slice = match ty. kind ( ) {
829
+ let is_slice = match ty. kind {
830
830
ty:: Ref ( _, subty, _) => is_slice_like ( cx, subty) ,
831
831
ty:: Slice ( ..) | ty:: Array ( ..) => true ,
832
832
_ => false ,
@@ -1403,7 +1403,7 @@ fn is_end_eq_array_len<'tcx>(
1403
1403
if_chain ! {
1404
1404
if let ExprKind :: Lit ( ref lit) = end. kind;
1405
1405
if let ast:: LitKind :: Int ( end_int, _) = lit. node;
1406
- if let ty:: Array ( _, arr_len_const) = indexed_ty. kind( ) ;
1406
+ if let ty:: Array ( _, arr_len_const) = indexed_ty. kind;
1407
1407
if let Some ( arr_len) = arr_len_const. try_eval_usize( cx. tcx, cx. param_env) ;
1408
1408
then {
1409
1409
return match limits {
@@ -1640,7 +1640,7 @@ fn check_for_loop_over_map_kv<'tcx>(
1640
1640
if let PatKind :: Tuple ( ref pat, _) = pat. kind {
1641
1641
if pat. len ( ) == 2 {
1642
1642
let arg_span = arg. span ;
1643
- let ( new_pat_span, kind, ty, mutbl) = match * cx. typeck_results ( ) . expr_ty ( arg) . kind ( ) {
1643
+ let ( new_pat_span, kind, ty, mutbl) = match cx. typeck_results ( ) . expr_ty ( arg) . kind {
1644
1644
ty:: Ref ( _, ty, mutbl) => match ( & pat[ 0 ] . kind , & pat[ 1 ] . kind ) {
1645
1645
( key, _) if pat_is_wild ( key, body) => ( pat[ 1 ] . span , "value" , ty, mutbl) ,
1646
1646
( _, value) if pat_is_wild ( value, body) => ( pat[ 0 ] . span , "key" , ty, Mutability :: Not ) ,
@@ -1968,7 +1968,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1968
1968
for expr in args {
1969
1969
let ty = self . cx . typeck_results ( ) . expr_ty_adjusted ( expr) ;
1970
1970
self . prefer_mutable = false ;
1971
- if let ty:: Ref ( _, _, mutbl) = * ty. kind ( ) {
1971
+ if let ty:: Ref ( _, _, mutbl) = ty. kind {
1972
1972
if mutbl == Mutability :: Mut {
1973
1973
self . prefer_mutable = true ;
1974
1974
}
@@ -1980,7 +1980,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
1980
1980
let def_id = self . cx . typeck_results ( ) . type_dependent_def_id ( expr. hir_id ) . unwrap ( ) ;
1981
1981
for ( ty, expr) in self . cx . tcx . fn_sig ( def_id) . inputs ( ) . skip_binder ( ) . iter ( ) . zip ( args) {
1982
1982
self . prefer_mutable = false ;
1983
- if let ty:: Ref ( _, _, mutbl) = * ty. kind ( ) {
1983
+ if let ty:: Ref ( _, _, mutbl) = ty. kind {
1984
1984
if mutbl == Mutability :: Mut {
1985
1985
self . prefer_mutable = true ;
1986
1986
}
@@ -2078,7 +2078,7 @@ fn is_ref_iterable_type(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
2078
2078
2079
2079
fn is_iterable_array < ' tcx > ( ty : Ty < ' tcx > , cx : & LateContext < ' tcx > ) -> bool {
2080
2080
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
2081
- match ty. kind ( ) {
2081
+ match ty. kind {
2082
2082
ty:: Array ( _, n) => n
2083
2083
. try_eval_usize ( cx. tcx , cx. param_env )
2084
2084
. map_or ( false , |val| ( 0 ..=32 ) . contains ( & val) ) ,
0 commit comments