From 4be11e911662706ffa353225434cd8bd05ea9677 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Tue, 19 Apr 2016 21:41:45 -0700 Subject: [PATCH] Removed unnecessary restriction of unsafe_removed_from_name to top-level use statements --- src/unsafe_removed_from_name.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/unsafe_removed_from_name.rs b/src/unsafe_removed_from_name.rs index 86860c67cfe..404d6d93604 100644 --- a/src/unsafe_removed_from_name.rs +++ b/src/unsafe_removed_from_name.rs @@ -1,6 +1,6 @@ use rustc::hir::*; use rustc::lint::*; -use syntax::ast::{Name, NodeId}; +use syntax::ast::Name; use syntax::codemap::Span; use syntax::parse::token::InternedString; use utils::span_lint; @@ -33,16 +33,7 @@ impl LintPass for UnsafeNameRemoval { } impl LateLintPass for UnsafeNameRemoval { - fn check_mod(&mut self, cx: &LateContext, m: &Mod, _: Span, _: NodeId) { - // only check top level `use` statements - for item in &m.item_ids { - self.lint_item(cx, cx.krate.item(item.id)); - } - } -} - -impl UnsafeNameRemoval { - fn lint_item(&self, cx: &LateContext, item: &Item) { + fn check_item(&mut self, cx: &LateContext, item: &Item) { if let ItemUse(ref item_use) = item.node { match item_use.node { ViewPath_::ViewPathSimple(ref name, ref path) => {