test: update tests for manual_instant_elapsed lint

This commit is contained in:
Nadir Fejzic 2022-11-07 21:37:04 +01:00
parent 80e3553f29
commit 4bd6d0beb0
3 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
// run-rustfix
#![warn(clippy::manual_instant_elapsed)]
#![allow(clippy::unnecessary_operation)]
#![allow(clippy::unchecked_duration_subtraction)]
#![allow(unused_variables)]
#![allow(unused_must_use)]

View file

@ -1,6 +1,7 @@
// run-rustfix
#![warn(clippy::manual_instant_elapsed)]
#![allow(clippy::unnecessary_operation)]
#![allow(clippy::unchecked_duration_subtraction)]
#![allow(unused_variables)]
#![allow(unused_must_use)]

View file

@ -1,5 +1,5 @@
error: manual implementation of `Instant::elapsed`
--> $DIR/manual_instant_elapsed.rs:17:20
--> $DIR/manual_instant_elapsed.rs:18:20
|
LL | let duration = Instant::now() - prev_instant;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `prev_instant.elapsed()`
@ -7,7 +7,7 @@ LL | let duration = Instant::now() - prev_instant;
= note: `-D clippy::manual-instant-elapsed` implied by `-D warnings`
error: manual implementation of `Instant::elapsed`
--> $DIR/manual_instant_elapsed.rs:26:5
--> $DIR/manual_instant_elapsed.rs:27:5
|
LL | Instant::now() - *ref_to_instant; // to ensure parens are added correctly
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*ref_to_instant).elapsed()`