File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
3
3
use clippy_utils:: msrvs:: { self , Msrv } ;
4
4
use clippy_utils:: source:: snippet_with_context;
5
5
use clippy_utils:: sugg:: Sugg ;
6
- use clippy_utils:: ty ;
6
+ use clippy_utils:: { is_path_diagnostic_item , ty } ;
7
7
use rustc_errors:: Applicability ;
8
8
use rustc_hir:: { BinOpKind , Expr , ExprKind } ;
9
9
use rustc_lint:: { LateContext , LateLintPass } ;
@@ -107,8 +107,7 @@ impl LateLintPass<'_> for InstantSubtraction {
107
107
108
108
fn is_instant_now_call ( cx : & LateContext < ' _ > , expr_block : & ' _ Expr < ' _ > ) -> bool {
109
109
if let ExprKind :: Call ( fn_expr, [ ] ) = expr_block. kind
110
- && let Some ( fn_id) = clippy_utils:: path_def_id ( cx, fn_expr)
111
- && cx. tcx . is_diagnostic_item ( sym:: instant_now, fn_id)
110
+ && is_path_diagnostic_item ( cx, fn_expr, sym:: instant_now)
112
111
{
113
112
true
114
113
} else {
You can’t perform that action at this time.
0 commit comments