mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
35 lines
1.4 KiB
Text
35 lines
1.4 KiB
Text
error: calling `subsec_millis()` is more concise than this calculation
|
|
--> tests/ui/duration_subsec.rs:9:24
|
|
|
|
|
LL | let bad_millis_1 = dur.subsec_micros() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_millis()`
|
|
|
|
|
= note: `-D clippy::duration-subsec` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::duration_subsec)]`
|
|
|
|
error: calling `subsec_millis()` is more concise than this calculation
|
|
--> tests/ui/duration_subsec.rs:10:24
|
|
|
|
|
LL | 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
|
|
--> tests/ui/duration_subsec.rs:15:22
|
|
|
|
|
LL | let bad_micros = dur.subsec_nanos() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
|
|
|
error: calling `subsec_micros()` is more concise than this calculation
|
|
--> tests/ui/duration_subsec.rs:20:13
|
|
|
|
|
LL | let _ = (&dur).subsec_nanos() / 1_000;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&dur).subsec_micros()`
|
|
|
|
error: calling `subsec_micros()` is more concise than this calculation
|
|
--> tests/ui/duration_subsec.rs:24:13
|
|
|
|
|
LL | let _ = dur.subsec_nanos() / NANOS_IN_MICRO;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `dur.subsec_micros()`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|