]> git.lizzy.rs Git - rust.git/commitdiff
Update docs
authorBrian Anderson <banderson@mozilla.com>
Fri, 8 Aug 2014 01:22:31 +0000 (18:22 -0700)
committerBrian Anderson <banderson@mozilla.com>
Wed, 13 Aug 2014 18:31:48 +0000 (11:31 -0700)
src/libstd/time/duration.rs

index c8c319f4121b5d68ebd8313f9ba11ccf1f7aa2bd..2fc7f47dc215ec93ddfc0f9577fd4dba3613be62 100644 (file)
@@ -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 {