-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Associated constants for new duration constructors #127700
Associated constants for new duration constructors #127700
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Do you have an ACP for these? They're not obvious enough to me that I'd be willing to approve them, even for nightly, without libs-api weighing in. @rustbot author |
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.
Adding these makes sense to me -- not sure if they should be part of the same feature?
@djc up to you. My thinking is it could be reasonable to bundle these associated constants with their required constructor counterparts as one feature. |
I don't think it's up to me -- I'm not a libs reviewer. |
@edwardwc this needs an ACP to be written to proceed. Once you have submitted the ACP, you can mention it here (preferably in the pr description) |
@edwardwc |
Closing this as no acp was created, and without that we can't move it forward. |
Add associated constants to the unstable Duration constructors. The tracking issue for these constructors is #120301.
This change aims to make interacting with time more clean and intuitive by providing predefined duration constants.
For example, to use a static for your sleep intervals:
Or with use of a
lazy_static
Or, to use it plainly