Closed korken89 closed 3 years ago
Thank you for this fix. Hope it gets merged soon!
When using seconds/milliseconds/etc, a workaround exists, as their implementation of PartialOrd and similar do work:
let milliseconds = Milliseconds(30_000u64);
duration_ms: Milliseconds<u64> = some_duration.try_into().unwrap();
// Comparing milliseconds to duration_ms will actually give
// the expected result, now
Looks perfect. Thank you!
Generics do not do comparisons correctly, their fractions are ignored and only the integer parts are compared.
This fixes this issue.