From 26792a65cdd79a086f7894bd1bf75d5b5ad10327 Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Mon, 10 Aug 2020 21:01:58 +0200 Subject: [PATCH] Move to doc links inside std/time.rs --- library/std/src/time.rs | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/library/std/src/time.rs b/library/std/src/time.rs index 9f4fa89cd55..07b07c0fbe3 100644 --- a/library/std/src/time.rs +++ b/library/std/src/time.rs @@ -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); @@ -125,11 +124,6 @@ /// 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 @@ -176,7 +170,6 @@ /// [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 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 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 /// -- 2.44.0