Skip to content

Commit 3c93abd

Browse files
committed
Make fixes from upgrading master
1 parent 10009a7 commit 3c93abd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clippy_lints/src/use_last.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
33
use crate::utils::{match_type, paths, snippet_with_applicability, span_lint_and_sugg, SpanlessEq};
44
use if_chain::if_chain;
5-
use rustc::hir::{Expr, ExprKind};
5+
use rustc::hir::{Expr, ExprKind, BinOpKind};
66
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
77
use rustc::{declare_lint_pass, declare_tool_lint};
88
use rustc_errors::Applicability;
99
use syntax::ast::LitKind;
10+
use syntax::symbol::Symbol;
11+
use syntax::source_map::Spanned;
1012

1113
declare_clippy_lint! {
1214
/// **What it does:** Checks for using `x.get(x.len() - 1)` instead of
@@ -49,12 +51,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseLast {
4951
if let ExprKind::MethodCall(ref path, _, ref args) = expr.node;
5052

5153
// Method name is "get"
52-
if path.ident.name == "get";
54+
if path.ident.name == Symbol::intern("get");
5355

5456
// Argument 0 (the struct we're calling the method on) is a vector
5557
if let Some(struct_calling_on) = args.get(0);
5658
let struct_ty = cx.tables.expr_ty(struct_calling_on);
57-
if match_type(cx, struct_ty, &paths::VEC);
59+
if match_type(cx, struct_ty, &*paths::VEC);
5860

5961
// Argument to "get" is a binary operation
6062
if let Some(get_index_arg) = args.get(1);

0 commit comments

Comments
 (0)