Refactor: Remove utils::opt_def_id

This removes some indirection. Probably this method was uplifted to
rustc at some point?
This commit is contained in:
Philipp Hansch
2019-03-08 14:14:41 +01:00
parent 00baf7a111
commit 9d97ed6faa
18 changed files with 41 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
use crate::utils::{is_copy, match_def_path, opt_def_id, paths, span_note_and_lint};
use crate::utils::{is_copy, match_def_path, paths, span_note_and_lint};
use if_chain::if_chain;
use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
@@ -124,7 +124,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
if let ExprKind::Call(ref path, ref args) = expr.node;
if let ExprKind::Path(ref qpath) = path.node;
if args.len() == 1;
if let Some(def_id) = opt_def_id(cx.tables.qpath_def(qpath, path.hir_id));
if let Some(def_id) = cx.tables.qpath_def(qpath, path.hir_id).opt_def_id();
then {
let lint;
let msg;