Repository navigation
feat(time): add Duration extractors for units larger than second - #165624
Conversation
|
r? jhpratt As I said in the ACP, personally I'm okay with weeks and days, but there was a difference of opinions there. I'll take a look when the team gets around to discussing the ACP (I expect the minutes and hours to be uncontroversial). |
|
I think I think asymmetric states should be avoided. |
|
Let's keep discussion in the ACP :) I provided a summary of the tradeoffs and opinions for T-libs. |
|
@rustbot label S-waiting-on-ACP |
|
@rustbot label -S-waiting-on-ACP |
|
I had forgotten about things like #162195, so I took the corresponding actions. |
|
@jhpratt What is lacking for a review? |
|
You pinging me 😆 I simply forgot about this PR and haven't been active on reviews recently. The team was in favor, so let's land as-is and defer a decision on days/weeks to later (along with the corresponding consts and constructors). @bors r+ rollup |
…ctors, r=jhpratt feat(time): add `Duration` extractors for units larger than second - Accepted ACP: rust-lang/libs-team#923 - Tracking issue: - rust-lang#165784 - rust-lang#165786 This pull request adds `Duration::as_{weeks,days,hours,mins}` methods for units larger than the second. Based on rust-lang#120301 and rust-lang#140881, the features are divided into the `duration_extractors` feature for `Duration::as_{weeks,days}` methods and the `duration_extractors_lite` feature for `Duration::as_{hours,mins}` methods.
Rollup of 5 pull requests Successful merges: - #166438 (add test checking that -Ctarget-feature implies cfg(target_feature)) - #165624 (feat(time): add `Duration` extractors for units larger than second) - #166231 (Added regression test for issue #53156 ) - #166401 (Add explanatory comment and rename alias ) - #166520 (Fix typo in ConstItemInteriorMutationsDiag struct)
Rollup of 9 pull requests Successful merges: - #166438 (add test checking that -Ctarget-feature implies cfg(target_feature)) - #166536 (Make `issue-96797.rs` link again) - #165624 (feat(time): add `Duration` extractors for units larger than second) - #166231 (Added regression test for issue #53156 ) - #166401 (Add explanatory comment and rename alias ) - #166520 (Fix typo in ConstItemInteriorMutationsDiag struct) - #166540 (Return `Err` from `send_process_group_signal` if leader has been awaited) - #166544 (rustc-dev-guide subtree update) - #166545 (Run more autodiff tests in CI)
Rollup merge of #165624 - sorairolake:feature/duration-extractors, r=jhpratt feat(time): add `Duration` extractors for units larger than second - Accepted ACP: rust-lang/libs-team#923 - Tracking issue: - #165784 - #165786 This pull request adds `Duration::as_{weeks,days,hours,mins}` methods for units larger than the second. Based on #120301 and #140881, the features are divided into the `duration_extractors` feature for `Duration::as_{weeks,days}` methods and the `duration_extractors_lite` feature for `Duration::as_{hours,mins}` methods.
|
@sorairolake in the future could you please make sure your git history is free from back-and-forth changes? I.e. squash smaller changes that don't have a reason to be split up. Thanks! |
|
Whoops, that's also on me as a reviewer |
|
@tgross35 I'm sorry, since the number of commits was small, I thought it might not be necessary to squash them. |
Durationextractors for units larger than the second libs-team#923duration_extractors_lite#165784duration_extractors#165786This pull request adds
Duration::as_{weeks,days,hours,mins}methods for units larger than the second.Based on #120301 and #140881, the features are divided into the
duration_extractorsfeature forDuration::as_{weeks,days}methods and theduration_extractors_litefeature forDuration::as_{hours,mins}methods.