ExprKind
This commit is contained in:
parent
2a016890a0
commit
1bd17e4fa2
90 changed files with 777 additions and 777 deletions
|
@ -79,7 +79,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LenZero {
|
|||
return;
|
||||
}
|
||||
|
||||
if let ExprBinary(Spanned { node: cmp, .. }, ref left, ref right) = expr.node {
|
||||
if let ExprKind::Binary(Spanned { node: cmp, .. }, ref left, ref right) = expr.node {
|
||||
match cmp {
|
||||
BiEq => {
|
||||
check_cmp(cx, expr.span, left, right, "", 0); // len == 0
|
||||
|
@ -194,7 +194,7 @@ fn check_impl_items(cx: &LateContext, item: &Item, impl_items: &[ImplItemRef]) {
|
|||
}
|
||||
|
||||
fn check_cmp(cx: &LateContext, span: Span, method: &Expr, lit: &Expr, op: &str, compare_to: u32) {
|
||||
if let (&ExprMethodCall(ref method_path, _, ref args), &ExprLit(ref lit)) = (&method.node, &lit.node) {
|
||||
if let (&ExprKind::MethodCall(ref method_path, _, ref args), &ExprKind::Lit(ref lit)) = (&method.node, &lit.node) {
|
||||
// check if we are in an is_empty() method
|
||||
if let Some(name) = get_item_name(cx, method) {
|
||||
if name == "is_empty" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue