From: Nadir Fejzic Date: Sat, 1 Oct 2022 14:50:56 +0000 (+0200) Subject: style: remove `dbg!` call X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b485832b16a388dbcfd3c42030356959e7662a3d;p=rust.git style: remove `dbg!` call --- diff --git a/clippy_lints/src/unchecked_duration_subtraction.rs b/clippy_lints/src/unchecked_duration_subtraction.rs index fb08067de8d..ae796000662 100644 --- a/clippy_lints/src/unchecked_duration_subtraction.rs +++ b/clippy_lints/src/unchecked_duration_subtraction.rs @@ -71,9 +71,7 @@ fn is_an_instant(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { let expr_ty = cx.typeck_results().expr_ty(expr); match expr_ty.kind() { - rustc_middle::ty::Adt(def, _) => { - clippy_utils::match_def_path(cx, dbg!(def).did(), &clippy_utils::paths::INSTANT) - }, + rustc_middle::ty::Adt(def, _) => clippy_utils::match_def_path(cx, def.did(), &clippy_utils::paths::INSTANT), _ => false, } } diff --git a/tests/ui/unchecked_duration_subtraction.stderr b/tests/ui/unchecked_duration_subtraction.stderr index 827b18a5a09..6b297a01c7b 100644 --- a/tests/ui/unchecked_duration_subtraction.stderr +++ b/tests/ui/unchecked_duration_subtraction.stderr @@ -1,4 +1,3 @@ -[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant error: unchecked subtraction of a 'Duration' from an 'Instant' --> $DIR/unchecked_duration_subtraction.rs:9:13 | @@ -7,21 +6,18 @@ LL | let _ = _first - second; | = note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings` -[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant error: unchecked subtraction of a 'Duration' from an 'Instant' --> $DIR/unchecked_duration_subtraction.rs:11:13 | LL | let _ = Instant::now() - Duration::from_secs(5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap();` -[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant error: unchecked subtraction of a 'Duration' from an 'Instant' --> $DIR/unchecked_duration_subtraction.rs:13:13 | LL | let _ = _first - Duration::from_secs(5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap();` -[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant error: unchecked subtraction of a 'Duration' from an 'Instant' --> $DIR/unchecked_duration_subtraction.rs:15:13 |