Skip to content

Commit 4bd6d0b

Browse files
committed
test: update tests for manual_instant_elapsed lint
1 parent 80e3553 commit 4bd6d0b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

tests/ui/manual_instant_elapsed.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22
#![warn(clippy::manual_instant_elapsed)]
33
#![allow(clippy::unnecessary_operation)]
4+
#![allow(clippy::unchecked_duration_subtraction)]
45
#![allow(unused_variables)]
56
#![allow(unused_must_use)]
67

tests/ui/manual_instant_elapsed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22
#![warn(clippy::manual_instant_elapsed)]
33
#![allow(clippy::unnecessary_operation)]
4+
#![allow(clippy::unchecked_duration_subtraction)]
45
#![allow(unused_variables)]
56
#![allow(unused_must_use)]
67

tests/ui/manual_instant_elapsed.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: manual implementation of `Instant::elapsed`
2-
--> $DIR/manual_instant_elapsed.rs:17:20
2+
--> $DIR/manual_instant_elapsed.rs:18:20
33
|
44
LL | let duration = Instant::now() - prev_instant;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `prev_instant.elapsed()`
66
|
77
= note: `-D clippy::manual-instant-elapsed` implied by `-D warnings`
88

99
error: manual implementation of `Instant::elapsed`
10-
--> $DIR/manual_instant_elapsed.rs:26:5
10+
--> $DIR/manual_instant_elapsed.rs:27:5
1111
|
1212
LL | Instant::now() - *ref_to_instant; // to ensure parens are added correctly
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*ref_to_instant).elapsed()`

0 commit comments

Comments
 (0)