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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user