use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::LateContext;
use syntax::ast::Name;
-use syntax::codemap::Span;
+use syntax::source_map::Span;
use crate::utils::{get_pat_name, match_var, snippet};
pub fn get_spans(
- cx: &LateContext,
+ cx: &LateContext<'_, '_>,
opt_body_id: Option<BodyId>,
idx: usize,
replacements: &'static [(&'static str, &'static str)],
if self.abort {
return;
}
- if let ExprMethodCall(ref seg, _, ref args) = expr.node {
+ if let ExprKind::MethodCall(ref seg, _, ref args) = expr.node {
if args.len() == 1 && match_var(&args[0], self.name) {
- if seg.name == "capacity" {
+ if seg.ident.name == "capacity" {
self.abort = true;
return;
}
for &(fn_name, suffix) in self.replace {
- if seg.name == fn_name {
+ if seg.ident.name == fn_name {
self.spans
.push((expr.span, snippet(self.cx, args[0].span, "_") + suffix));
return;