Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Aug 13, 2014
1 parent 31281b4 commit 49a40d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libstd/time/duration.rs
Expand Up @@ -119,7 +119,10 @@ impl Duration {
Duration { nanos: nanos as u32, ..Duration::seconds(secs) }
}

/// Same as `to_tuple` but returns a tuple compatible to `to_negated_tuple`.
/// Returns a tuple of the number of days, (non-leap) seconds and
/// nanoseconds in the duration. Note that the number of seconds
/// and nanoseconds are always positive, so that for example
/// `-Duration::seconds(3)` has -1 days and 86,397 seconds.
#[inline]
fn to_tuple_64(&self) -> (i64, u32, u32) {
(self.days as i64, self.secs, self.nanos)
Expand Down Expand Up @@ -170,7 +173,7 @@ impl Duration {
self.num_seconds() / 60
}

/// Returns the total number of (non-leap) whole seconds in the duration.
/// Returns the total number of whole seconds in the duration.
pub fn num_seconds(&self) -> i64 {
// cannot overflow, 2^32 * 86400 < 2^64
fn secs((days, secs, _): (i64, u32, u32)) -> i64 {
Expand Down

0 comments on commit 49a40d8

Please sign in to comment.