use rustc::lint::*;
use syntax::ast::*;
-use std::ops::Deref;
use syntax::ext::quote::rt::Span;
use utils::span_note_and_lint;
cx,
UNIT_EXPR,
expr.span,
- "This expression assigns the Unit type ()",
+ "This expression evaluates to the Unit type ()",
span,
"Consider removing the trailing semicolon",
);
cx,
UNIT_EXPR,
expr.span,
- "This expression assigns the Unit type ()",
+ "This expression evaluates to the Unit type ()",
span,
"Consider removing the trailing semicolon",
);
cx,
UNIT_EXPR,
expr.span,
- "This expression assigns the Unit type ()",
+ "This expression evaluates to the Unit type ()",
span,
"Consider removing the trailing semicolon",
);
cx,
UNIT_EXPR,
expr.span,
- "This expression assigns the Unit type ()",
+ "This expression evaluates to the Unit type ()",
span,
"Consider removing the trailing semicolon",
);
ExprKind::If(_, ref then, ref else_) => {
let check_then = check_last_stmt_in_block(then);
if let Some(ref else_) = *else_ {
- let check_else = is_unit_expr(else_.deref());
+ let check_else = is_unit_expr(&else_);
if let Some(ref expr_else) = check_else {
return Some(expr_else.clone());
}