11if_chain! {
2- if let ExprKind::DropTemps(ref expr) = expr.kind;
2+ if let ExprKind::DropTemps(expr) = expr.kind;
33 if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, ..}) = higher::ForLoop::hir(expr);
44 if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = pat.kind;
55 if name.as_str() == "y";
6- if let ExprKind::Struct(ref qpath, ref fields, None) = arg.kind;
6+ if let ExprKind::Struct(qpath, fields, None) = arg.kind;
77 if matches!(qpath, QPath::LangItem(LangItem::Range, _));
88 if fields.len() == 2;
99 if fields[0].ident.name.as_str() == "start";
@@ -12,10 +12,10 @@ if_chain! {
1212 if fields[1].ident.name.as_str() == "end";
1313 if let ExprKind::Lit(ref lit1) = fields[1].expr.kind;
1414 if let LitKind::Int(10, LitIntType::Unsuffixed) = lit1.node;
15- if let ExprKind::Block(ref block, ref label) = body.kind;
15+ if let ExprKind::Block(block, label) = body.kind;
1616 if block.stmts.len() == 1;
17- if let StmtKind::Local(ref local) = block.stmts[0].kind;
18- if let Some(ref init) = local.init;
17+ if let StmtKind::Local(local) = block.stmts[0].kind;
18+ if let Some(init) = local.init;
1919 if let ExprKind::Path(ref qpath1) = init.kind;
2020 if match_qpath(qpath1, &["y"]);
2121 if let PatKind::Binding(BindingAnnotation::Unannotated, _, name1, None) = local.pat.kind;
@@ -26,10 +26,10 @@ if_chain! {
2626 }
2727}
2828if_chain! {
29- if let ExprKind::DropTemps(ref expr) = expr.kind;
29+ if let ExprKind::DropTemps(expr) = expr.kind;
3030 if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, ..}) = higher::ForLoop::hir(expr);
3131 if let PatKind::Wild = pat.kind;
32- if let ExprKind::Struct(ref qpath, ref fields, None) = arg.kind;
32+ if let ExprKind::Struct(qpath, fields, None) = arg.kind;
3333 if matches!(qpath, QPath::LangItem(LangItem::Range, _));
3434 if fields.len() == 2;
3535 if fields[0].ident.name.as_str() == "start";
@@ -38,20 +38,20 @@ if_chain! {
3838 if fields[1].ident.name.as_str() == "end";
3939 if let ExprKind::Lit(ref lit1) = fields[1].expr.kind;
4040 if let LitKind::Int(10, LitIntType::Unsuffixed) = lit1.node;
41- if let ExprKind::Block(ref block, ref label) = body.kind;
41+ if let ExprKind::Block(block, label) = body.kind;
4242 if block.stmts.len() == 1;
43- if let StmtKind::Semi(ref e) = block.stmts[0].kind;
44- if let ExprKind::Break(ref destination, None) = e.kind;
43+ if let StmtKind::Semi(e) = block.stmts[0].kind;
44+ if let ExprKind::Break(destination, None) = e.kind;
4545 if block.expr.is_none();
4646 then {
4747 // report your lint here
4848 }
4949}
5050if_chain! {
51- if let ExprKind::DropTemps(ref expr) = expr.kind;
51+ if let ExprKind::DropTemps(expr) = expr.kind;
5252 if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, ..}) = higher::ForLoop::hir(expr);
5353 if let PatKind::Wild = pat.kind;
54- if let ExprKind::Struct(ref qpath, ref fields, None) = arg.kind;
54+ if let ExprKind::Struct(qpath, fields, None) = arg.kind;
5555 if matches!(qpath, QPath::LangItem(LangItem::Range, _));
5656 if fields.len() == 2;
5757 if fields[0].ident.name.as_str() == "start";
@@ -60,11 +60,11 @@ if_chain! {
6060 if fields[1].ident.name.as_str() == "end";
6161 if let ExprKind::Lit(ref lit1) = fields[1].expr.kind;
6262 if let LitKind::Int(10, LitIntType::Unsuffixed) = lit1.node;
63- if let ExprKind::Block(ref block, ref label) = body.kind;
63+ if let ExprKind::Block(block, label) = body.kind;
6464 if block.stmts.len() == 1;
65- if let StmtKind::Semi(ref e) = block.stmts[0].kind;
66- if let ExprKind::Break(ref destination, None) = e.kind;
67- if let Some(ref label1) = destination.label;
65+ if let StmtKind::Semi(e) = block.stmts[0].kind;
66+ if let ExprKind::Break(destination, None) = e.kind;
67+ if let Some(label1) = destination.label;
6868 if label_name.ident.name.as_str() == "'label";
6969 if block.expr.is_none();
7070 then {
@@ -75,36 +75,36 @@ if_chain! {
7575 if let Some(higher::While { condition: condition, body: body }) = higher::While::hir(expr);
7676 if let ExprKind::Path(ref qpath) = condition.kind;
7777 if match_qpath(qpath, &["a"]);
78- if let ExprKind::Block(ref block, ref label) = body.kind;
78+ if let ExprKind::Block(block, label) = body.kind;
7979 if block.stmts.len() == 1;
80- if let StmtKind::Semi(ref e) = block.stmts[0].kind;
81- if let ExprKind::Break(ref destination, None) = e.kind;
80+ if let StmtKind::Semi(e) = block.stmts[0].kind;
81+ if let ExprKind::Break(destination, None) = e.kind;
8282 if block.expr.is_none();
8383 then {
8484 // report your lint here
8585 }
8686}
8787if_chain! {
8888 if let Some(higher::WhileLet { let_pat: let_pat, let_expr: let_expr, if_then: if_then }) = higher::WhileLet::hir(expr);
89- if let PatKind::Lit(ref lit_expr) = let_pat.kind;
89+ if let PatKind::Lit(lit_expr) = let_pat.kind;
9090 if let ExprKind::Lit(ref lit) = lit_expr.kind;
9191 if let LitKind::Bool(true) = lit.node;
9292 if let ExprKind::Path(ref qpath) = let_expr.kind;
9393 if match_qpath(qpath, &["a"]);
94- if let ExprKind::Block(ref block, ref label) = if_then.kind;
94+ if let ExprKind::Block(block, label) = if_then.kind;
9595 if block.stmts.len() == 1;
96- if let StmtKind::Semi(ref e) = block.stmts[0].kind;
97- if let ExprKind::Break(ref destination, None) = e.kind;
96+ if let StmtKind::Semi(e) = block.stmts[0].kind;
97+ if let ExprKind::Break(destination, None) = e.kind;
9898 if block.expr.is_none();
9999 then {
100100 // report your lint here
101101 }
102102}
103103if_chain! {
104- if let ExprKind::Loop(ref body, ref label, LoopSource::Loop, _) = expr.kind;
104+ if let ExprKind::Loop(body, label, LoopSource::Loop, _) = expr.kind;
105105 if body.stmts.len() == 1;
106- if let StmtKind::Semi(ref e) = body.stmts[0].kind;
107- if let ExprKind::Break(ref destination, None) = e.kind;
106+ if let StmtKind::Semi(e) = body.stmts[0].kind;
107+ if let ExprKind::Break(destination, None) = e.kind;
108108 if body.expr.is_none();
109109 then {
110110 // report your lint here
0 commit comments