Skip to content

Commit b485832

Browse files
committed
style: remove dbg! call
1 parent b280dbe commit b485832

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

clippy_lints/src/unchecked_duration_subtraction.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ fn is_an_instant(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
7171
let expr_ty = cx.typeck_results().expr_ty(expr);
7272

7373
match expr_ty.kind() {
74-
rustc_middle::ty::Adt(def, _) => {
75-
clippy_utils::match_def_path(cx, dbg!(def).did(), &clippy_utils::paths::INSTANT)
76-
},
74+
rustc_middle::ty::Adt(def, _) => clippy_utils::match_def_path(cx, def.did(), &clippy_utils::paths::INSTANT),
7775
_ => false,
7876
}
7977
}

tests/ui/unchecked_duration_subtraction.stderr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant
21
error: unchecked subtraction of a 'Duration' from an 'Instant'
32
--> $DIR/unchecked_duration_subtraction.rs:9:13
43
|
@@ -7,21 +6,18 @@ LL | let _ = _first - second;
76
|
87
= note: `-D clippy::unchecked-duration-subtraction` implied by `-D warnings`
98

10-
[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant
119
error: unchecked subtraction of a 'Duration' from an 'Instant'
1210
--> $DIR/unchecked_duration_subtraction.rs:11:13
1311
|
1412
LL | let _ = Instant::now() - Duration::from_secs(5);
1513
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Instant::now().checked_sub(Duration::from_secs(5)).unwrap();`
1614

17-
[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant
1815
error: unchecked subtraction of a 'Duration' from an 'Instant'
1916
--> $DIR/unchecked_duration_subtraction.rs:13:13
2017
|
2118
LL | let _ = _first - Duration::from_secs(5);
2219
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `_first.checked_sub(Duration::from_secs(5)).unwrap();`
2320

24-
[clippy_lints/src/unchecked_duration_subtraction.rs:75] def = std::time::Instant
2521
error: unchecked subtraction of a 'Duration' from an 'Instant'
2622
--> $DIR/unchecked_duration_subtraction.rs:15:13
2723
|

0 commit comments

Comments
 (0)