]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/path_buf_push_overwrite.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / path_buf_push_overwrite.rs
index 3234c81de23ee05d440e8c1c00da1617c4b42895..8ebb5150ab473a63a6e4af6402bcb32e12843177 100644 (file)
@@ -1,4 +1,3 @@
-use crate::utils::sym;
 use crate::utils::{match_type, paths, span_lint_and_sugg, walk_ptrs_ty};
 use if_chain::if_chain;
 use rustc::hir::*;
@@ -45,9 +44,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PathBufPushOverwrite {
     fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
         if_chain! {
             if let ExprKind::MethodCall(ref path, _, ref args) = expr.node;
-            if path.ident.name == *sym::push;
+            if path.ident.name == sym!(push);
             if args.len() == 2;
-            if match_type(cx, walk_ptrs_ty(cx.tables.expr_ty(&args[0])), &*paths::PATH_BUF);
+            if match_type(cx, walk_ptrs_ty(cx.tables.expr_ty(&args[0])), &paths::PATH_BUF);
             if let Some(get_index_arg) = args.get(1);
             if let ExprKind::Lit(ref lit) = get_index_arg.node;
             if let LitKind::Str(ref path_lit, _) = lit.node;