mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
test: update tests for manual_instant_elapsed lint
This commit is contained in:
parent
80e3553f29
commit
4bd6d0beb0
3 changed files with 4 additions and 2 deletions
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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()`
|
||||
|
|
Loading…
Reference in a new issue