Skip to content
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

Merged
merged 3 commits into from Jul 24, 2021
Merged

Conversation

danieldulaney
Copy link
Contributor

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 an std::time::Duration.

An alternative approach would be to make the inner timespec field pub, which would not require any additional functions but would expose some (potentially unwanted) implementation details.

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
Copy link
Member

@asomers asomers left a 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?

@danieldulaney
Copy link
Contributor Author

I think this is the correct way to add an entry -- is this the first change for this version?

Copy link
Member

@asomers asomers left a 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.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors bors bot merged commit e88a6cf into nix-rust:master Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants