mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
34 lines
1.4 KiB
Text
34 lines
1.4 KiB
Text
error: Calling `subsec_millis()` is more concise than this calculation
|
|
--> $DIR/duration_subsec.rs:20:24
|
|
|
|
|
20 | let bad_millis_1 = dur.subsec_micros() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
|
|
|
|
= note: `-D clippy::duration-subsec` implied by `-D warnings`
|
|
|
|
error: Calling `subsec_millis()` is more concise than this calculation
|
|
--> $DIR/duration_subsec.rs:21:24
|
|
|
|
|
21 | let bad_millis_2 = dur.subsec_nanos() / 1_000_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
|
|
|
error: Calling `subsec_micros()` is more concise than this calculation
|
|
--> $DIR/duration_subsec.rs:26:22
|
|
|
|
|
26 | let bad_micros = dur.subsec_nanos() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
|
|
|
error: Calling `subsec_micros()` is more concise than this calculation
|
|
--> $DIR/duration_subsec.rs:31:13
|
|
|
|
|
31 | let _ = (&dur).subsec_nanos() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&dur).subsec_micros()`
|
|
|
|
error: Calling `subsec_micros()` is more concise than this calculation
|
|
--> $DIR/duration_subsec.rs:35:13
|
|
|
|
|
35 | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|