aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_plugins/unrooted_must_root.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script_plugins/unrooted_must_root.rs')
-rw-r--r--components/script_plugins/unrooted_must_root.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs
index 58700e5d6b6..dc38054720c 100644
--- a/components/script_plugins/unrooted_must_root.rs
+++ b/components/script_plugins/unrooted_must_root.rs
@@ -7,7 +7,7 @@ use rustc::hir::intravisit as visit;
use rustc::hir::{self, ExprKind};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
use rustc::ty;
-use syntax::{ast, source_map, symbol::Ident};
+use syntax::{ast, source_map};
declare_lint!(
UNROOTED_MUST_ROOT,
@@ -168,8 +168,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
id: ast::NodeId,
) {
let in_new_function = match kind {
- visit::FnKind::ItemFn(n, _, _, _, _) |
- visit::FnKind::Method(Ident { name: n, .. }, _, _, _) => {
+ visit::FnKind::ItemFn(n, _, _, _, _) | visit::FnKind::Method(n, _, _, _) => {
&*n.as_str() == "new" || n.as_str().starts_with("new_")
},
visit::FnKind::Closure(_) => return,