Skip to content

Enable creating a const TimeSpec#1465

Merged
bors[bot] merged 3 commits intonix-rust:masterfrom
danieldulaney:const_timespec
Jul 24, 2021
Merged

Enable creating a const TimeSpec#1465
bors[bot] merged 3 commits intonix-rust:masterfrom
danieldulaney:const_timespec

Conversation

@danieldulaney
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@danieldulaney danieldulaney requested a review from asomers July 14, 2021 06:52
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants