This is a follow-up to #2479 for switching from From to TryFrom for conversions between TimeSpec and Duration which may underflow or overflow
I learned that From and TryFrom can 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 a TryFromIntError which 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
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
What does this PR do
From
toTryFrom
for conversions betweenTimeSpec
andDuration
which may underflow or overflowFrom
andTryFrom
can 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 hereTryFrom
. The underlying integer conversions return aTryFromIntError
which informs that the conversion has failed but gives no specific reason.Checklist:
CONTRIBUTING.md