Was getting panic:
thread 'tests::test_wraparound_correctness' panicked at C:\Users\User\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\jiff-0.2.6\src\signed_duration.rs:473:9:
assertion failed: nanos <= 999_999_999
Had to write helper method:
fn safe_signed_duration_from_secs_f64(seconds: f64) -> SignedDuration {
let total_nanos = (seconds * 1_000_000_000.0).round() as i64;
let secs = total_nanos / 1_000_000_000;
let nanos = total_nanos % 1_000_000_000;
SignedDuration::from_secs(secs) + SignedDuration::from_nanos(nanos)
}
Was getting panic:
Had to write helper method: