-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable creating a const TimeSpec #1465
Conversation
Previously, there was no way to create a TimeSpec in a const context because all creation was through traits. This adds two utility functions to create a const TimeSpec from a libc::timespec or a std::time::Duration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Would you mind adding a CHANGELOG entry?
I think this is the correct way to add an entry -- is this the first change for this version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Previously, there was no way to create a
TimeSpec
in aconst
context because all creation was through traits. This adds two utility functions to create aconst TimeSpec
from alibc::timespec
or anstd::time::Duration
.An alternative approach would be to make the inner
timespec
fieldpub
, which would not require any additional functions but would expose some (potentially unwanted) implementation details.