nix
nix copied to clipboard
Use TryFrom for TimeSpec/Duration conversions which may underflow/overflow
trafficstars
What does this PR do
- This is a follow-up to #2479 for switching from
FromtoTryFromfor conversions betweenTimeSpecandDurationwhich may underflow or overflow - I learned that
FromandTryFromcan not co-exist and so adding the latter and deprecating the former does not seem feasible and it looks like we are left with a breaking change here - I'm starting this as a draft PR for
- Discussing the desired level of detail for reporting errors from
TryFrom. The underlying integer conversions return aTryFromIntErrorwhich informs that the conversion has failed but gives no specific reason. - Getting feedback from CI
- Adding tests for the conversions once the course for this PR is set
- Adding a change log once the course for this PR is set
- Discussing the desired level of detail for reporting errors from
Checklist:
- [x] I have read
CONTRIBUTING.md - [ ] I have written necessary tests and rustdoc comments
- [ ] A change log has been added if this PR modifies nix's API