Uh oh!
There was an error while loading. Please reload this page.
std: Redesign Duration, implementing RFC 1040 - #24920
Conversation
rust-highfive
commented
Apr 29, 2015
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Apr 29, 2015
r? @aturon cc @wycats The only "surprise" I had during the implementation was the naming of the methods here and there. Abbreviating "seconds" as "secs" didn't feel super rustic to me, but typing millis/nanos felt much better than milliseconds/nanoseconds. Overall I didn't feel too strongly either way! |
c0d3aa8 to
260ce79CompareThere was a problem hiding this comment.
What's the motivation for this sort of 'complicated' formatting rather than something like, say, 1234.00000567s?
There was a problem hiding this comment.
I'm not particularly wed to this format, but it's what was specified in the RFC (as a starting point). I also had some reservations and wouldn't mind changing it to be only numeric as well.
There was a problem hiding this comment.
Hm, I also have mixed feelings about this actually looking at this code (I should have raised this with the RFC). I think that automatically figuring out whether to use seconds, millis, or nanos is a good idea, but I don't understand the motivation for XX seconds and XX nanoseconds.
bors
commented
Apr 29, 2015
☔ The latest upstream changes (presumably #24888) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
Apr 30, 2015
☔ The latest upstream changes (presumably #24967) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
This changes the behavior for a zero duration; intended?
aturon
commented
May 4, 2015
@alexcrichton Ok, I've done a preliminary pass. Looks nice a simple. I raised a few concerns (most of which, to be honest, I should have raised on the RFC). |
alexcrichton
commented
May 7, 2015
Ok I have updated some feedback and discussion with @aturon:
re-r? @aturon |
2fe4199 to
f143b01CompareThere was a problem hiding this comment.
There should exist From<Duration> for libc::timespec in liblibc instead.
There was a problem hiding this comment.
Unfortunately this can't be provided in liblibc because Duration doesn't exist by that point and due to the in-tree liblibc being different from the out-of-tree liblibc it unfortunately also wouldn't work to provide this in the standard library as well.
alexcrichton
commented
May 11, 2015
Thanks for taking a look @nagisa! |
aturon
commented
May 13, 2015
@bors: r+ |
bors
commented
May 13, 2015
📌 Commit 086fddc has been approved by |
aturon
commented
May 13, 2015
Thanks @alexcrichton! |
bors
commented
May 13, 2015
⌛ Testing commit 086fddc with merge 9eb94a8... |
bors
commented
May 13, 2015
💔 Test failed - auto-mac-64-nopt-t |
Manishearth
commented
May 13, 2015
|
cd06e02 to
38cfc7aComparealexcrichton
commented
May 13, 2015
bors
commented
May 13, 2015
⌛ Testing commit 38cfc7a with merge 9b165c0... |
bors
commented
May 14, 2015
💔 Test failed - auto-win-64-opt |
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closesrust-lang#24874
alexcrichton
commented
May 14, 2015
bors
commented
May 14, 2015
⌛ Testing commit 556e76b with merge 0755c09... |
bors
commented
May 14, 2015
💔 Test failed - auto-linux-32-nopt-t |
alexcrichton
commented
May 14, 2015
@bors: retry On Wed, May 13, 2015 at 8:36 PM, bors notifications@github.com wrote:
|
bors
commented
May 14, 2015
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes#24874
This commit is an implementation of RFC 1040 which is a redesign of the
currently-unstable
Durationtype. The API of the type has been scaled back tobe more conservative and it also no longer supports negative durations.
The inner
durationmodule of thetimemodule has now been hidden (asDurationis reexported) and the feature name for this type has changed fromstd_misctoduration. All APIs accepting durations have also been audited totake a more flavorful feature name instead of
std_misc.Closes#24874