Update docs
This commit is contained in:
parent
31281b4bd1
commit
49a40d8ad1
@ -119,7 +119,10 @@ pub fn nanoseconds(nanos: i32) -> 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)
|
||||
@ -170,7 +173,7 @@ pub fn num_minutes(&self) -> i64 {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user