error invalid-duration
Некорректный литерал длительности.
What it means#
Duration units are ns us ms s m h d. A compound duration lists units in strictly decreasing order without spaces, for example 1h30m15s (§1.5). Repeating a unit, writing units in ascending order, or inserting spaces is an error. Months and years are not duration units at all; they belong to Period (§17.2).
Example#
fn main() {
let wait = 30m1h // <- invalid-duration (units must decrease: h before m)
}error
invalid-duration
How to fix#
fn main() {
let wait = 1h30m
}Order the components from the largest unit to the smallest, each at most once. For calendar intervals use Period, e.g. 1.month.