@@ -6,7 +6,7 @@ LL | let dur = Duration::from_secs(60);
66 |
77 = note: `-D clippy::duration-suboptimal-units` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::duration_suboptimal_units)]`
9- help: try using from_mins
9+ help: try using `Duration:: from_mins`
1010 |
1111LL - let dur = Duration::from_secs(60);
1212LL + let dur = Duration::from_mins(1);
@@ -18,7 +18,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
1818LL | let dur = Duration::from_secs(180);
1919 | ^^^^^^^^^^^^^^^^^^^^^^^^
2020 |
21- help: try using from_mins
21+ help: try using `Duration:: from_mins`
2222 |
2323LL - let dur = Duration::from_secs(180);
2424LL + let dur = Duration::from_mins(3);
@@ -30,7 +30,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
3030LL | let dur = Duration::from_secs(10 * 60);
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232 |
33- help: try using from_mins
33+ help: try using `Duration:: from_mins`
3434 |
3535LL - let dur = Duration::from_secs(10 * 60);
3636LL + let dur = Duration::from_mins(10);
@@ -42,7 +42,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
4242LL | let dur = Duration::from_mins(24 * 60);
4343 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444 |
45- help: try using from_hours
45+ help: try using `Duration:: from_hours`
4646 |
4747LL - let dur = Duration::from_mins(24 * 60);
4848LL + let dur = Duration::from_hours(24);
@@ -54,7 +54,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
5454LL | let dur = Duration::from_millis(5_000);
5555 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656 |
57- help: try using from_secs
57+ help: try using `Duration:: from_secs`
5858 |
5959LL - let dur = Duration::from_millis(5_000);
6060LL + let dur = Duration::from_secs(5);
@@ -66,7 +66,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
6666LL | let dur = Duration::from_nanos(13 * 60 * 60 * 1_000 * 1_000 * 1_000);
6767 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6868 |
69- help: try using from_hours
69+ help: try using `Duration:: from_hours`
7070 |
7171LL - let dur = Duration::from_nanos(13 * 60 * 60 * 1_000 * 1_000 * 1_000);
7272LL + let dur = Duration::from_hours(13);
@@ -78,7 +78,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
7878LL | let dur = Duration::from_millis(5_000);
7979 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8080 |
81- help: try using from_secs
81+ help: try using `Duration:: from_secs`
8282 |
8383LL - let dur = Duration::from_millis(5_000);
8484LL + let dur = Duration::from_secs(5);
@@ -90,7 +90,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
9090LL | let dur = Duration::from_secs(180);
9191 | ^^^^^^^^^^^^^^^^^^^^^^^^
9292 |
93- help: try using from_mins
93+ help: try using `Duration:: from_mins`
9494 |
9595LL - let dur = Duration::from_secs(180);
9696LL + let dur = Duration::from_mins(3);
@@ -102,7 +102,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
102102LL | let dur = Duration::from_mins(24 * 60);
103103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104 |
105- help: try using from_hours
105+ help: try using `Duration:: from_hours`
106106 |
107107LL - let dur = Duration::from_mins(24 * 60);
108108LL + let dur = Duration::from_hours(24);
@@ -114,7 +114,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
114114LL | std::time::Duration::from_secs(60);
115115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
116116 |
117- help: try using from_mins
117+ help: try using `Duration:: from_mins`
118118 |
119119LL - std::time::Duration::from_secs(60);
120120LL + std::time::Duration::from_mins(1);
@@ -126,7 +126,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
126126LL | assert_eq!(Duration::from_secs(3_600), Duration::from_mins(6));
127127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
128128 |
129- help: try using from_hours
129+ help: try using `Duration:: from_hours`
130130 |
131131LL - assert_eq!(Duration::from_secs(3_600), Duration::from_mins(6));
132132LL + assert_eq!(Duration::from_hours(1), Duration::from_mins(6));
@@ -142,7 +142,7 @@ LL | let dur = mac!(duration);
142142 | -------------- in this macro invocation
143143 |
144144 = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
145- help: try using from_mins
145+ help: try using `Duration:: from_mins`
146146 |
147147LL - Duration::from_secs(300)
148148LL + Duration::from_mins(5)
@@ -154,7 +154,7 @@ error: constructing a `Duration` using a smaller unit when a larger unit would b
154154LL | _ = Duration::from_secs(67_768_040_922_076_800);
155155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156156 |
157- help: try using from_hours
157+ help: try using `Duration:: from_hours`
158158 |
159159LL - _ = Duration::from_secs(67_768_040_922_076_800);
160160LL + _ = Duration::from_hours(18824455811688);
0 commit comments