]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/returns.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / returns.rs
index 73fbc172c1010208f0228c789f5bb02e4c174251..2bfc1e7d107121e0e1e2642d531fe3a3e185e34f 100644 (file)
@@ -1,4 +1,6 @@
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
 use syntax::ast;
 use syntax::codemap::Span;
 use syntax::visit::FnKind;
@@ -114,7 +116,7 @@ fn check_let_return(&mut self, cx: &EarlyContext, block: &ast::Block) {
             if let Some(ref initexpr) = local.init;
             if let ast::PatKind::Ident(_, ident, _) = local.pat.node;
             if let ast::ExprKind::Path(_, ref path) = retexpr.node;
-            if match_path_ast(path, &[&ident.name.as_str()]);
+            if match_path_ast(path, &[&ident.as_str()]);
             if !in_external_macro(cx, initexpr.span);
             then {
                     span_note_and_lint(cx,