Check method calls

This commit is contained in:
Zaki Manian 2017-09-02 14:19:45 -07:00
parent 2a97aadacf
commit d6d78cdbbe

View File

@ -46,12 +46,31 @@ impl EarlyLintPass for UnitExpr {
)
}
}
// if let ExprKind::MethodCall(ref path, ref args) = expr.node {
// unimplemented!();
// }
// if let ExprKind::Call(ref path, ref args) = expr.node{
// unimplemented!();
// }
if let ExprKind::MethodCall(_, ref args) = expr.node {
for ref arg in args{
if is_unit_expr(arg){
span_lint_and_sugg(
cx,
UNIT_EXPR,
arg.span,
"trailing semicolons can be tricky",
"remove the last semicolon",
"TODO".to_owned()
)
} }
}
if let ExprKind::Call( _, ref args) = expr.node{
for ref arg in args{
if is_unit_expr(arg){
span_lint_and_sugg(
cx,
UNIT_EXPR,
arg.span,
"trailing semicolons can be tricky",
"remove the last semicolon",
"TODO".to_owned()
)
} } }
}
fn check_stmt(&mut self, cx: &EarlyContext, stmt: &Stmt) {