]> git.lizzy.rs Git - rust.git/commitdiff
style: remove `dbg!` call
authorNadir Fejzic <nadirfejzo@gmail.com>
Sat, 1 Oct 2022 14:50:56 +0000 (16:50 +0200)
committerNadir Fejzic <nadirfejzo@gmail.com>
Thu, 10 Nov 2022 14:46:56 +0000 (15:46 +0100)
clippy_lints/src/unchecked_duration_subtraction.rs
tests/ui/unchecked_duration_subtraction.stderr

index fb08067de8d4fd8be64823dea0044c4e671f8758..ae79600066296e4d10731eedd652b9cf655f8668 100644 (file)
@@ -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,
     }
 }
index 827b18a5a0972d39a3e0b80abe108a5fcb8a43bb..6b297a01c7be222fb50a7787a327e0cef8387cab 100644 (file)
@@ -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
    |