From a5b294864a99ebdd742202c4fce51506adc3aa0b Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:45:14 +0200 Subject: [PATCH 1/7] doc: remove info repeated on next paragraph --- src/libstd/time/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index 3e01ed894b8c..f74d26560769 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -22,8 +22,7 @@ pub use self::duration::Duration; mod duration; -/// A measurement of a monotonically increasing clock which is suitable for -/// measuring the amount of time that an operation takes. +/// A measurement of a monotonically increasing clock. /// /// Instants are guaranteed always be greater than any previously measured /// instant when created, and are often useful for tasks such as measuring From e15dd99b7b76f2d5b8dd6b728cdbc25a5859da12 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:45:39 +0200 Subject: [PATCH 2/7] doc: fix grammar --- src/libstd/time/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index f74d26560769..1c26efb4fbff 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -24,7 +24,7 @@ mod duration; /// A measurement of a monotonically increasing clock. /// -/// Instants are guaranteed always be greater than any previously measured +/// Instants are always guaranteed to be greater than any previously measured /// instant when created, and are often useful for tasks such as measuring /// benchmarks or timing how long an operation takes. /// From a4c0a6fccda8045a52cc2d5e21bff8d2689ac30c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:46:39 +0200 Subject: [PATCH 3/7] doc: add missing commas --- src/libstd/time/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index 1c26efb4fbff..5d0d0fd9d2e9 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -29,7 +29,7 @@ mod duration; /// benchmarks or timing how long an operation takes. /// /// Note, however, that instants are not guaranteed to be **steady**. In other -/// words each tick of the underlying clock may not be the same length (e.g. +/// words, each tick of the underlying clock may not be the same length (e.g. /// some seconds may be longer than others). An instant may jump forwards or /// experience time dilation (slow down or speed up), but it will never go /// backwards. @@ -59,7 +59,7 @@ pub struct Instant(time::Instant); /// Although a `SystemTime` cannot be directly inspected, the `UNIX_EPOCH` /// constant is provided in this module as an anchor in time to learn /// information about a `SystemTime`. By calculating the duration from this -/// fixed point in time a `SystemTime` can be converted to a human-readable time +/// fixed point in time, a `SystemTime` can be converted to a human-readable time, /// or perhaps some other string representation. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] #[unstable(feature = "time2", reason = "recently added", issue = "29866")] From d447ceaedb08c1409e3c11b1cf616d2770d5559d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:47:17 +0200 Subject: [PATCH 4/7] doc: split overlong sentence --- src/libstd/time/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index 5d0d0fd9d2e9..3633f66fa59f 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -35,8 +35,8 @@ mod duration; /// backwards. /// /// Instants are opaque types that can only be compared to one another. There is -/// no method to get "the number of seconds" from an instant but instead it only -/// allow learning the duration between two instants (or comparing two +/// no method to get "the number of seconds" from an instant. Instead, it only +/// allows measuring the duration between two instants (or comparing two /// instants). #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] #[unstable(feature = "time2", reason = "recently added", issue = "29866")] From 44665c4e61acd72dc8b3cccee4cb3258a19194d0 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:50:47 +0200 Subject: [PATCH 5/7] doc: add a pause --- src/libstd/time/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index 3633f66fa59f..ac8e6ca7d3ae 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -94,8 +94,9 @@ impl Instant { /// /// # Panics /// - /// This function may panic if the current time is earlier than this instant - /// which can happen if an `Instant` is produced synthetically. + /// This function may panic if the current time is earlier than this + /// instant, which is something that can happen if an `Instant` is + /// produced synthetically. pub fn elapsed(&self) -> Duration { Instant::now().duration_from_earlier(*self) } From 3dd7e6ed7c9e2f71844923c96de18241d4a9fded Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:51:01 +0200 Subject: [PATCH 6/7] doc: fix type name --- src/libstd/time/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index ac8e6ca7d3ae..a9d4c79abfcc 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -140,7 +140,7 @@ impl SystemTime { /// guaranteed to always be before later measurements (due to anomalies such /// as the system clock being adjusted either forwards or backwards). /// - /// If successful, `Ok(duration)` is returned where the duration represents + /// If successful, `Ok(Duration)` is returned where the duration represents /// the amount of time elapsed from the specified measurement to this one. /// /// Returns an `Err` if `earlier` is later than `self`, and the error From cc815d2de087c85aa416693edcba2006774383ed Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 25 Nov 2015 22:52:12 +0200 Subject: [PATCH 7/7] doc: this is already mentioned in previous paragraph, and is harder to read --- src/libstd/time/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index a9d4c79abfcc..261f3e266d7d 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -207,9 +207,8 @@ impl SystemTimeError { /// second system time was from the first. /// /// A `SystemTimeError` is returned from the `duration_from_earlier` - /// operation whenever the second duration, `earlier`, actually represents a - /// point later in time than the `self` of the method call. This function - /// will extract and return the amount of time later `earlier` actually is. + /// operation whenever the second system time represents a point later + /// in time than the `self` of the method call. pub fn duration(&self) -> Duration { self.0 }