Skip to content

Commit 49a40d8

Browse files
committed
Update docs
1 parent 31281b4 commit 49a40d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libstd/time/duration.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ impl Duration {
119119
Duration { nanos: nanos as u32, ..Duration::seconds(secs) }
120120
}
121121

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

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

0 commit comments

Comments
 (0)