11error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
2- --> tests/ui/duration_suboptimal_units.rs:27 :15
2+ --> tests/ui/duration_suboptimal_units.rs:26 :15
33 |
44LL | let dur = Duration::from_secs(59 + 1);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,31 @@ LL + let dur = Duration::from_mins(1);
1313 |
1414
1515error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
16- --> tests/ui/duration_suboptimal_units.rs:30:15
16+ --> tests/ui/duration_suboptimal_units.rs:38:15
17+ |
18+ LL | let dur = Duration::from_millis(20_000);
19+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+ |
21+ help: try using from_secs
22+ |
23+ LL - let dur = Duration::from_millis(20_000);
24+ LL + let dur = Duration::from_secs(20);
25+ |
26+
27+ error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
28+ --> tests/ui/duration_suboptimal_units.rs:40:15
29+ |
30+ LL | let dur = Duration::from_mins(720);
31+ | ^^^^^^^^^^^^^^^^^^^^^^^^
32+ |
33+ help: try using from_hours
34+ |
35+ LL - let dur = Duration::from_mins(720);
36+ LL + let dur = Duration::from_hours(12);
37+ |
38+
39+ error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
40+ --> tests/ui/duration_suboptimal_units.rs:43:15
1741 |
1842LL | let dur = Duration::from_secs(60 * 3);
1943 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +49,7 @@ LL + let dur = Duration::from_mins(3);
2549 |
2650
2751error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
28- --> tests/ui/duration_suboptimal_units.rs:32 :15
52+ --> tests/ui/duration_suboptimal_units.rs:45 :15
2953 |
3054LL | let dur = Duration::from_secs(10 * 60);
3155 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +61,7 @@ LL + let dur = Duration::from_mins(10);
3761 |
3862
3963error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
40- --> tests/ui/duration_suboptimal_units.rs:34 :15
64+ --> tests/ui/duration_suboptimal_units.rs:47 :15
4165 |
4266LL | let dur = Duration::from_mins(24 * 60);
4367 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +73,7 @@ LL + let dur = Duration::from_hours(24);
4973 |
5074
5175error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
52- --> tests/ui/duration_suboptimal_units.rs:37 :15
76+ --> tests/ui/duration_suboptimal_units.rs:49 :15
5377 |
5478LL | let dur = Duration::from_millis(5 * 1000);
5579 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +85,7 @@ LL + let dur = Duration::from_secs(5);
6185 |
6286
6387error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
64- --> tests/ui/duration_suboptimal_units.rs:39 :15
88+ --> tests/ui/duration_suboptimal_units.rs:51 :15
6589 |
6690LL | let dur = Duration::from_nanos(13 * 60 * 60 * 1_000 * 1_000 * 1_000);
6791 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -73,7 +97,7 @@ LL + let dur = Duration::from_hours(13);
7397 |
7498
7599error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
76- --> tests/ui/duration_suboptimal_units.rs:51 :19
100+ --> tests/ui/duration_suboptimal_units.rs:63 :19
77101 |
78102LL | let dur = Duration::from_millis(1000 * 5);
79103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -85,7 +109,7 @@ LL + let dur = Duration::from_secs(5);
85109 |
86110
87111error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
88- --> tests/ui/duration_suboptimal_units.rs:53 :19
112+ --> tests/ui/duration_suboptimal_units.rs:65 :19
89113 |
90114LL | let dur = Duration::from_millis(11000);
91115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -97,7 +121,7 @@ LL + let dur = Duration::from_secs(11);
97121 |
98122
99123error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
100- --> tests/ui/duration_suboptimal_units.rs:58 :19
124+ --> tests/ui/duration_suboptimal_units.rs:70 :19
101125 |
102126LL | let dur = Duration::from_secs(39600);
103127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -109,7 +133,7 @@ LL + let dur = Duration::from_hours(11);
109133 |
110134
111135error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
112- --> tests/ui/duration_suboptimal_units.rs:60 :19
136+ --> tests/ui/duration_suboptimal_units.rs:72 :19
113137 |
114138LL | let dur = Duration::from_secs(3 * 60);
115139 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,7 +145,7 @@ LL + let dur = Duration::from_mins(3);
121145 |
122146
123147error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
124- --> tests/ui/duration_suboptimal_units.rs:62 :19
148+ --> tests/ui/duration_suboptimal_units.rs:74 :19
125149 |
126150LL | let dur = Duration::from_mins(24 * 60);
127151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -133,7 +157,7 @@ LL + let dur = Duration::from_hours(24);
133157 |
134158
135159error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
136- --> tests/ui/duration_suboptimal_units.rs:70 :16
160+ --> tests/ui/duration_suboptimal_units.rs:82 :16
137161 |
138162LL | assert_eq!(Duration::from_secs(60 * 60), Duration::from_mins(6));
139163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -161,7 +185,7 @@ LL + Duration::from_mins(5)
161185 |
162186
163187error: constructing a `Duration` using a smaller unit when a larger unit would be more readable
164- --> tests/ui/duration_suboptimal_units.rs:105 :9
188+ --> tests/ui/duration_suboptimal_units.rs:125 :9
165189 |
166190LL | _ = Duration::from_secs(67_768_040_922_076_800);
167191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,5 +196,5 @@ LL - _ = Duration::from_secs(67_768_040_922_076_800);
172196LL + _ = Duration::from_hours(18824455811688);
173197 |
174198
175- error: aborting due to 13 previous errors
199+ error: aborting due to 16 previous errors
176200
0 commit comments