summary refs log tree commit diff
path: root/src/libstd/time
AgeCommit message (Collapse)AuthorLines
2014-09-03Fix spelling errors and capitalization.Joseph Crail-1/+1
2014-08-28libstd: Wrap duration.rs at 100 characters.Ruud van Asseldonk-3/+6
2014-08-21libstd: Limit Duration range to i64 milliseconds.Ruud van Asseldonk-39/+49
This enables `num_milliseconds` to return an `i64` again instead of `Option<i64>`, because it is guaranteed not to overflow. The Duration range is now rougly 300e6 years (positive and negative), whereas it was 300e9 years previously. To put these numbers in perspective, 300e9 years is about 21 times the age of the universe (according to Wolfram|Alpha). 300e6 years is about 1/15 of the age of the earth (according to Wolfram|Alpha).
2014-08-20libstd: Refactor Duration.Ruud van Asseldonk-282/+190
This changes the internal representation of `Duration` from days: i32, secs: i32, nanos: u32 to secs: i64, nanos: i32 This resolves #16466. Some methods now take `i64` instead of `i32` due to the increased range. Some methods, like `num_milliseconds`, now return an `Option<i64>` instead of `i64`, because the range of `Duration` is now larger than e.g. 2^63 milliseconds.
2014-08-15Derive Clone for std::time::DurationAndrew Poelstra-1/+1
This is needed to derive Clone for types containing Durations.
2014-08-13Add a fixme about Duration representationBrian Anderson-0/+2
2014-08-13Update docsBrian Anderson-2/+5
2014-08-13std: Fix build errorsBrian Anderson-1/+1
2014-08-13std: Remove Duration::new/new_opt/to_tupleBrian Anderson-37/+0
These all expose the underlying data representation and are not the most convenient way of instantiation anyway.
2014-08-13std: Improve Duration commentsBrian Anderson-17/+2
2014-08-13std: Refactor time module a bitBrian Anderson-0/+696
Put `Duration` in `time::duration`, where the two constants can be called just `MAX` and `MIN`. Reexport from `time`. This provides more room for the time module to expand.