Commit 4fa9499
fix: improve Duration conversion safety and documentation
- Add clamping to u64::MAX to prevent overflow
- Document that u64 can represent up to ~584 years
- Add safety comment for Duration::from_nanos
- Address code review feedback on potential data loss
Co-authored-by: doublegate <6858123+doublegate@users.noreply.github.com>1 parent 6509f41 commit 4fa9499
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
| |||
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| 697 | + | |
695 | 698 | | |
696 | 699 | | |
697 | 700 | | |
| |||
0 commit comments