Skip to content

Commit 72d7b9c

Browse files
committed
author: Remove needless refs
1 parent a806ce7 commit 72d7b9c

File tree

10 files changed

+151
-169
lines changed

10 files changed

+151
-169
lines changed

clippy_lints/src/utils/author.rs

Lines changed: 66 additions & 84 deletions
Large diffs are not rendered by default.

tests/ui/author.stdout

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if_chain! {
2-
if let StmtKind::Local(ref local) = stmt.kind;
3-
if let Some(ref init) = local.init;
4-
if let ExprKind::Cast(ref expr, ref cast_ty) = init.kind;
2+
if let StmtKind::Local(local) = stmt.kind;
3+
if let Some(init) = local.init;
4+
if let ExprKind::Cast(expr, cast_ty) = init.kind;
55
if let TyKind::Path(ref qpath) = cast_ty.kind;
66
if match_qpath(qpath, &["char"]);
77
if let ExprKind::Lit(ref lit) = expr.kind;

tests/ui/author/blocks.stdout

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
if_chain! {
2-
if let ExprKind::Block(ref block, ref label) = expr.kind;
2+
if let ExprKind::Block(block, label) = expr.kind;
33
if block.stmts.len() == 3;
4-
if let StmtKind::Local(ref local) = block.stmts[0].kind;
5-
if let Some(ref init) = local.init;
4+
if let StmtKind::Local(local) = block.stmts[0].kind;
5+
if let Some(init) = local.init;
66
if let ExprKind::Lit(ref lit) = init.kind;
77
if let LitKind::Int(42, LitIntType::Signed(IntTy::I32)) = lit.node;
88
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local.pat.kind;
99
if name.as_str() == "x";
10-
if let StmtKind::Local(ref local1) = block.stmts[1].kind;
11-
if let Some(ref init1) = local1.init;
10+
if let StmtKind::Local(local1) = block.stmts[1].kind;
11+
if let Some(init1) = local1.init;
1212
if let ExprKind::Lit(ref lit1) = init1.kind;
1313
if let LitKind::Float(_, LitFloatType::Suffixed(FloatTy::F32)) = lit1.node;
1414
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name1, None) = local1.pat.kind;
1515
if name1.as_str() == "_t";
16-
if let StmtKind::Semi(ref e) = block.stmts[2].kind;
17-
if let ExprKind::Unary(UnOp::Neg, ref inner) = e.kind;
16+
if let StmtKind::Semi(e) = block.stmts[2].kind;
17+
if let ExprKind::Unary(UnOp::Neg, inner) = e.kind;
1818
if let ExprKind::Path(ref qpath) = inner.kind;
1919
if match_qpath(qpath, &["x"]);
2020
if block.expr.is_none();
@@ -23,18 +23,18 @@ if_chain! {
2323
}
2424
}
2525
if_chain! {
26-
if let ExprKind::Block(ref block, ref label) = expr.kind;
26+
if let ExprKind::Block(block, label) = expr.kind;
2727
if block.stmts.len() == 1;
28-
if let StmtKind::Local(ref local) = block.stmts[0].kind;
29-
if let Some(ref init) = local.init;
30-
if let ExprKind::Call(ref func, ref args) = init.kind;
28+
if let StmtKind::Local(local) = block.stmts[0].kind;
29+
if let Some(init) = local.init;
30+
if let ExprKind::Call(func, args) = init.kind;
3131
if let ExprKind::Path(ref qpath) = func.kind;
3232
if match_qpath(qpath, &["String", "new"]);
3333
if args.len() == 0;
3434
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local.pat.kind;
3535
if name.as_str() == "expr";
36-
if let Some(trailing_expr) = &block.expr;
37-
if let ExprKind::Call(ref func1, ref args1) = trailing_expr.kind;
36+
if let Some(trailing_expr) = block.expr;
37+
if let ExprKind::Call(func1, args1) = trailing_expr.kind;
3838
if let ExprKind::Path(ref qpath1) = func1.kind;
3939
if match_qpath(qpath1, &["drop"]);
4040
if args1.len() == 1;
@@ -45,17 +45,17 @@ if_chain! {
4545
}
4646
}
4747
if_chain! {
48-
if let ExprKind::Closure(CaptureBy::Value, ref fn_decl, ref body_id, _, None) = expr.kind;
48+
if let ExprKind::Closure(CaptureBy::Value, fn_decl, body_id, _, None) = expr.kind;
4949
if let FnRetTy::DefaultReturn(_) = fn_decl.output;
5050
let body = cx.tcx.hir().body(body_id);
51-
if let ExprKind::Call(ref func, ref args) = body.value.kind;
51+
if let ExprKind::Call(func, args) = body.value.kind;
5252
if let ExprKind::Path(ref qpath) = func.kind;
5353
if matches!(qpath, QPath::LangItem(LangItem::FromGenerator, _));
5454
if args.len() == 1;
55-
if let ExprKind::Closure(CaptureBy::Value, ref fn_decl1, ref body_id1, _, Some(Movability::Static)) = args[0].kind;
55+
if let ExprKind::Closure(CaptureBy::Value, fn_decl1, body_id1, _, Some(Movability::Static)) = args[0].kind;
5656
if let FnRetTy::DefaultReturn(_) = fn_decl1.output;
5757
let body1 = cx.tcx.hir().body(body_id1);
58-
if let ExprKind::Block(ref block, ref label) = body1.value.kind;
58+
if let ExprKind::Block(block, label) = body1.value.kind;
5959
if block.stmts.len() == 0;
6060
if block.expr.is_none();
6161
then {

tests/ui/author/call.stdout

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if_chain! {
2-
if let StmtKind::Local(ref local) = stmt.kind;
3-
if let Some(ref init) = local.init;
4-
if let ExprKind::Call(ref func, ref args) = init.kind;
2+
if let StmtKind::Local(local) = stmt.kind;
3+
if let Some(init) = local.init;
4+
if let ExprKind::Call(func, args) = init.kind;
55
if let ExprKind::Path(ref qpath) = func.kind;
66
if match_qpath(qpath, &["{{root}}", "std", "cmp", "min"]);
77
if args.len() == 2;

tests/ui/author/if.stdout

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
if_chain! {
2-
if let StmtKind::Local(ref local) = stmt.kind;
3-
if let Some(ref init) = local.init;
2+
if let StmtKind::Local(local) = stmt.kind;
3+
if let Some(init) = local.init;
44
if let Some(higher::If { cond: cond, then: then, r#else: else_expr}) = higher::If::hir(init);
55
if let ExprKind::Lit(ref lit) = cond.kind;
66
if let LitKind::Bool(true) = lit.node;
7-
if let ExprKind::Block(ref block, ref label) = then.kind;
7+
if let ExprKind::Block(block, label) = then.kind;
88
if block.stmts.len() == 1;
9-
if let StmtKind::Semi(ref e) = block.stmts[0].kind;
10-
if let ExprKind::Binary(ref op, ref left, ref right) = e.kind;
9+
if let StmtKind::Semi(e) = block.stmts[0].kind;
10+
if let ExprKind::Binary(op, left, right) = e.kind;
1111
if BinOpKind::Eq == op.node;
1212
if let ExprKind::Lit(ref lit1) = left.kind;
1313
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit1.node;
1414
if let ExprKind::Lit(ref lit2) = right.kind;
1515
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit2.node;
1616
if block.expr.is_none();
17-
if let ExprKind::Block(ref block1, ref label1) = else_expr.kind;
17+
if let ExprKind::Block(block1, label1) = else_expr.kind;
1818
if block1.stmts.len() == 1;
19-
if let StmtKind::Semi(ref e1) = block1.stmts[0].kind;
20-
if let ExprKind::Binary(ref op1, ref left1, ref right1) = e1.kind;
19+
if let StmtKind::Semi(e1) = block1.stmts[0].kind;
20+
if let ExprKind::Binary(op1, left1, right1) = e1.kind;
2121
if BinOpKind::Eq == op1.node;
2222
if let ExprKind::Lit(ref lit3) = left1.kind;
2323
if let LitKind::Int(2, LitIntType::Unsuffixed) = lit3.node;
@@ -31,15 +31,15 @@ if_chain! {
3131
}
3232
if_chain! {
3333
if let Some(higher::IfLet { let_pat: let_pat, let_expr: let_expr, if_then: if_then, if_else: else_expr}) = higher::IfLet::hir(expr);
34-
if let PatKind::Lit(ref lit_expr) = let_pat.kind;
34+
if let PatKind::Lit(lit_expr) = let_pat.kind;
3535
if let ExprKind::Lit(ref lit) = lit_expr.kind;
3636
if let LitKind::Bool(true) = lit.node;
3737
if let ExprKind::Path(ref qpath) = let_expr.kind;
3838
if match_qpath(qpath, &["a"]);
39-
if let ExprKind::Block(ref block, ref label) = if_then.kind;
39+
if let ExprKind::Block(block, label) = if_then.kind;
4040
if block.stmts.len() == 0;
4141
if block.expr.is_none();
42-
if let ExprKind::Block(ref block1, ref label1) = else_expr.kind;
42+
if let ExprKind::Block(block1, label1) = else_expr.kind;
4343
if block1.stmts.len() == 0;
4444
if block1.expr.is_none();
4545
then {

tests/ui/author/issue_3849.stdout

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if_chain! {
2-
if let StmtKind::Local(ref local) = stmt.kind;
3-
if let Some(ref init) = local.init;
4-
if let ExprKind::Call(ref func, ref args) = init.kind;
2+
if let StmtKind::Local(local) = stmt.kind;
3+
if let Some(init) = local.init;
4+
if let ExprKind::Call(func, args) = init.kind;
55
if let ExprKind::Path(ref qpath) = func.kind;
66
if match_qpath(qpath, &["std", "mem", "transmute"]);
77
if args.len() == 1;

tests/ui/author/loop.stdout

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
if_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
}
2828
if_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
}
5050
if_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
}
8787
if_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
}
103103
if_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

tests/ui/author/matches.stdout

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
if_chain! {
2-
if let StmtKind::Local(ref local) = stmt.kind;
3-
if let Some(ref init) = local.init;
4-
if let ExprKind::Match(ref scrutinee, ref arms, MatchSource::Normal) = init.kind;
2+
if let StmtKind::Local(local) = stmt.kind;
3+
if let Some(init) = local.init;
4+
if let ExprKind::Match(scrutinee, arms, MatchSource::Normal) = init.kind;
55
if let ExprKind::Lit(ref lit) = scrutinee.kind;
66
if let LitKind::Int(42, LitIntType::Unsuffixed) = lit.node;
77
if arms.len() == 3;
8-
if let PatKind::Lit(ref lit_expr) = arms[0].pat.kind;
8+
if let PatKind::Lit(lit_expr) = arms[0].pat.kind;
99
if let ExprKind::Lit(ref lit1) = lit_expr.kind;
1010
if let LitKind::Int(16, LitIntType::Unsuffixed) = lit1.node;
1111
if let ExprKind::Lit(ref lit2) = arms[0].body.kind;
1212
if let LitKind::Int(5, LitIntType::Unsuffixed) = lit2.node;
13-
if let PatKind::Lit(ref lit_expr1) = arms[1].pat.kind;
13+
if let PatKind::Lit(lit_expr1) = arms[1].pat.kind;
1414
if let ExprKind::Lit(ref lit3) = lit_expr1.kind;
1515
if let LitKind::Int(17, LitIntType::Unsuffixed) = lit3.node;
16-
if let ExprKind::Block(ref block, ref label) = arms[1].body.kind;
16+
if let ExprKind::Block(block, label) = arms[1].body.kind;
1717
if block.stmts.len() == 1;
18-
if let StmtKind::Local(ref local1) = block.stmts[0].kind;
19-
if let Some(ref init1) = local1.init;
18+
if let StmtKind::Local(local1) = block.stmts[0].kind;
19+
if let Some(init1) = local1.init;
2020
if let ExprKind::Lit(ref lit4) = init1.kind;
2121
if let LitKind::Int(3, LitIntType::Unsuffixed) = lit4.node;
2222
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local1.pat.kind;
2323
if name.as_str() == "x";
24-
if let Some(trailing_expr) = &block.expr;
24+
if let Some(trailing_expr) = block.expr;
2525
if let ExprKind::Path(ref qpath) = trailing_expr.kind;
2626
if match_qpath(qpath, &["x"]);
2727
if let PatKind::Wild = arms[2].pat.kind;

tests/ui/author/repeat.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if_chain! {
2-
if let ExprKind::Repeat(ref value, ref length) = expr.kind;
2+
if let ExprKind::Repeat(value, length) = expr.kind;
33
if let ExprKind::Lit(ref lit) = value.kind;
44
if let LitKind::Int(1, LitIntType::Unsigned(UintTy::U8)) = lit.node;
55
if let ExprKind::Lit(ref lit1) = length.value.kind;

tests/ui/author/struct.stdout

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
if_chain! {
2-
if let ExprKind::Struct(ref qpath, ref fields, None) = expr.kind;
2+
if let ExprKind::Struct(qpath, fields, None) = expr.kind;
33
if match_qpath(qpath, &["Test"]);
44
if fields.len() == 1;
55
if fields[0].ident.name.as_str() == "field";
66
if let Some(higher::If { cond: cond, then: then, r#else: else_expr}) = higher::If::hir(fields[0].expr);
77
if let ExprKind::Lit(ref lit) = cond.kind;
88
if let LitKind::Bool(true) = lit.node;
9-
if let ExprKind::Block(ref block, ref label) = then.kind;
9+
if let ExprKind::Block(block, label) = then.kind;
1010
if block.stmts.len() == 0;
11-
if let Some(trailing_expr) = &block.expr;
11+
if let Some(trailing_expr) = block.expr;
1212
if let ExprKind::Lit(ref lit1) = trailing_expr.kind;
1313
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit1.node;
14-
if let ExprKind::Block(ref block1, ref label1) = else_expr.kind;
14+
if let ExprKind::Block(block1, label1) = else_expr.kind;
1515
if block1.stmts.len() == 0;
16-
if let Some(trailing_expr1) = &block1.expr;
16+
if let Some(trailing_expr1) = block1.expr;
1717
if let ExprKind::Lit(ref lit2) = trailing_expr1.kind;
1818
if let LitKind::Int(0, LitIntType::Unsuffixed) = lit2.node;
1919
then {
2020
// report your lint here
2121
}
2222
}
2323
if_chain! {
24-
if let PatKind::Struct(ref qpath, ref fields, false) = arm.kind;
24+
if let PatKind::Struct(ref qpath, fields, false) = arm.kind;
2525
if match_qpath(qpath, &["Test"]);
2626
if fields.len() == 1;
2727
if fields[0].ident.name.as_str() == "field";
28-
if let PatKind::Lit(ref lit_expr) = fields[0].kind;
28+
if let PatKind::Lit(lit_expr) = fields[0].kind;
2929
if let ExprKind::Lit(ref lit) = lit_expr.kind;
3030
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit.node;
31-
if let ExprKind::Block(ref block, ref label) = lit_expr.kind;
31+
if let ExprKind::Block(block, label) = lit_expr.kind;
3232
if block.stmts.len() == 0;
3333
if block.expr.is_none();
3434
then {
3535
// report your lint here
3636
}
3737
}
3838
if_chain! {
39-
if let PatKind::TupleStruct(ref qpath, ref fields, None) = arm.kind;
39+
if let PatKind::TupleStruct(ref qpath, fields, None) = arm.kind;
4040
if match_qpath(qpath, &["TestTuple"]);
4141
if fields.len() == 1;
42-
if let PatKind::Lit(ref lit_expr) = fields[0].kind;
42+
if let PatKind::Lit(lit_expr) = fields[0].kind;
4343
if let ExprKind::Lit(ref lit) = lit_expr.kind;
4444
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit.node;
45-
if let ExprKind::Block(ref block, ref label) = lit_expr.kind;
45+
if let ExprKind::Block(block, label) = lit_expr.kind;
4646
if block.stmts.len() == 0;
4747
if block.expr.is_none();
4848
then {
4949
// report your lint here
5050
}
5151
}
5252
if_chain! {
53-
if let ExprKind::MethodCall(ref method_name, ref args, _) = expr.kind;
53+
if let ExprKind::MethodCall(method_name, _, args, _) = expr.kind;
5454
if method_name.ident.name.as_str() == test;
5555
if args.len() == 1;
5656
if let ExprKind::Path(ref qpath) = args[0].kind;

0 commit comments

Comments
 (0)