(num: f64, unit: Unit)
| 87 | } |
| 88 | |
| 89 | fn to_duration(num: f64, unit: Unit) -> Duration { |
| 90 | Duration::nanoseconds((num * unit.nanos() as f64).trunc() as i64) |
| 91 | } |
| 92 | |
| 93 | /// Formats a [`Duration`] into a string. String returns a string representing the |
| 94 | /// duration in the form "72h3m0.5s". Leading zero units are omitted. As a special |
no test coverage detected