|
1 | 1 | use crate::utils::paths;
|
2 | 2 | use crate::utils::{
|
3 |
| - in_macro, is_expn_of, last_path_segment, match_def_path, match_type, opt_def_id, resolve_node, snippet, |
4 |
| - span_lint_and_then, walk_ptrs_ty, |
| 3 | + in_macro, is_expn_of, last_path_segment, match_def_path, match_type, resolve_node, snippet, span_lint_and_then, |
| 4 | + walk_ptrs_ty, |
5 | 5 | };
|
6 | 6 | use if_chain::if_chain;
|
7 | 7 | use rustc::hir::*;
|
@@ -58,7 +58,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
|
58 | 58 | ExprKind::Call(ref fun, ref args) => {
|
59 | 59 | if_chain! {
|
60 | 60 | if let ExprKind::Path(ref qpath) = fun.node;
|
61 |
| - if let Some(fun_def_id) = opt_def_id(resolve_node(cx, qpath, fun.hir_id)); |
| 61 | + if let Some(fun_def_id) = resolve_node(cx, qpath, fun.hir_id).opt_def_id(); |
62 | 62 | let new_v1 = match_def_path(cx.tcx, fun_def_id, &paths::FMT_ARGUMENTS_NEWV1);
|
63 | 63 | let new_v1_fmt = match_def_path(
|
64 | 64 | cx.tcx,
|
@@ -159,7 +159,7 @@ fn get_single_string_arg<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr) -> Option
|
159 | 159 | if let ExprKind::Call(_, ref args) = exprs[0].node;
|
160 | 160 | if args.len() == 2;
|
161 | 161 | if let ExprKind::Path(ref qpath) = args[1].node;
|
162 |
| - if let Some(fun_def_id) = opt_def_id(resolve_node(cx, qpath, args[1].hir_id)); |
| 162 | + if let Some(fun_def_id) = resolve_node(cx, qpath, args[1].hir_id).opt_def_id(); |
163 | 163 | if match_def_path(cx.tcx, fun_def_id, &paths::DISPLAY_FMT_METHOD);
|
164 | 164 | then {
|
165 | 165 | let ty = walk_ptrs_ty(cx.tables.pat_ty(&pat[0]));
|
|
0 commit comments