]> git.lizzy.rs Git - rust.git/commitdiff
Move to doc links inside std/time.rs
authorAlexis Bourget <alexis.bourget@gmail.com>
Mon, 10 Aug 2020 19:01:58 +0000 (21:01 +0200)
committerAlexis Bourget <alexis.bourget@gmail.com>
Mon, 10 Aug 2020 19:01:58 +0000 (21:01 +0200)
library/std/src/time.rs

index 9f4fa89cd550624fad5d92716c5f14519c82d084..07b07c0fbe3047382b8f94de4fce24915d4c31a7 100644 (file)
@@ -97,7 +97,6 @@
 /// [clock_time_get (Monotonic Clock)]: https://nuxi.nl/cloudabi/#clock_time_get
 ///
 /// **Disclaimer:** These system calls might change over time.
-///
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[stable(feature = "time2", since = "1.8.0")]
 pub struct Instant(time::Instant);
 /// The size of a `SystemTime` struct may vary depending on the target operating
 /// system.
 ///
-/// [`Instant`]: ../../std/time/struct.Instant.html
-/// [`Result`]: ../../std/result/enum.Result.html
-/// [`Duration`]: ../../std/time/struct.Duration.html
-/// [`UNIX_EPOCH`]: ../../std/time/constant.UNIX_EPOCH.html
-///
 /// Example:
 ///
 /// ```no_run
 /// [GetSystemTimeAsFileTime]: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime
 ///
 /// **Disclaimer:** These system calls might change over time.
-///
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 #[stable(feature = "time2", since = "1.8.0")]
 pub struct SystemTime(time::SystemTime);
@@ -368,7 +361,7 @@ impl Add<Duration> for Instant {
     /// This function may panic if the resulting point in time cannot be represented by the
     /// underlying data structure. See [`checked_add`] for a version without panic.
     ///
-    /// [`checked_add`]: ../../std/time/struct.Instant.html#method.checked_add
+    /// [`checked_add`]: Instant::checked_add
     fn add(self, other: Duration) -> Instant {
         self.checked_add(other).expect("overflow when adding duration to instant")
     }
@@ -463,11 +456,6 @@ pub fn now() -> SystemTime {
     /// Returns an [`Err`] if `earlier` is later than `self`, and the error
     /// contains how far from `self` the time is.
     ///
-    /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
-    /// [`Duration`]: ../../std/time/struct.Duration.html
-    /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
-    /// [`Instant`]: ../../std/time/struct.Instant.html
-    ///
     /// # Examples
     ///
     /// ```
@@ -497,11 +485,6 @@ pub fn duration_since(&self, earlier: SystemTime) -> Result<Duration, SystemTime
     /// Returns an [`Err`] if `self` is later than the current system time, and
     /// the error contains how far from the current system time `self` is.
     ///
-    /// [`Ok`]: ../../std/result/enum.Result.html#variant.Ok
-    /// [`Duration`]: ../../std/time/struct.Duration.html
-    /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
-    /// [`Instant`]: ../../std/time/struct.Instant.html
-    ///
     /// # Examples
     ///
     /// ```no_run
@@ -544,7 +527,7 @@ impl Add<Duration> for SystemTime {
     /// This function may panic if the resulting point in time cannot be represented by the
     /// underlying data structure. See [`checked_add`] for a version without panic.
     ///
-    /// [`checked_add`]: ../../std/time/struct.SystemTime.html#method.checked_add
+    /// [`checked_add`]: SystemTime::checked_add
     fn add(self, dur: Duration) -> SystemTime {
         self.checked_add(dur).expect("overflow when adding duration to instant")
     }
@@ -589,8 +572,6 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 /// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
 /// [`SystemTime`] instance to represent another fixed point in time.
 ///
-/// [`SystemTime`]: ../../std/time/struct.SystemTime.html
-///
 /// # Examples
 ///
 /// ```no_run
@@ -612,9 +593,8 @@ impl SystemTimeError {
     /// methods of [`SystemTime`] whenever the second system time represents a point later
     /// in time than the `self` of the method call.
     ///
-    /// [`duration_since`]: ../../std/time/struct.SystemTime.html#method.duration_since
-    /// [`elapsed`]: ../../std/time/struct.SystemTime.html#method.elapsed
-    /// [`SystemTime`]: ../../std/time/struct.SystemTime.html
+    /// [`duration_since`]: SystemTime::duration_since
+    /// [`elapsed`]: SystemTime::elapsed
     ///
     /// # Examples
     ///