From e9e319c460468123200b90ab46871cf8288edfec Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Sun, 9 Aug 2020 21:20:57 +0200 Subject: [PATCH 1/3] Use intra-doc links --- library/core/src/time.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/library/core/src/time.rs b/library/core/src/time.rs index acaedbd135e7c..4d15a8d51af8a 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -33,9 +33,7 @@ const MICROS_PER_SEC: u64 = 1_000_000; /// `Duration`s implement many common traits, including [`Add`], [`Sub`], and other /// [`ops`] traits. It implements `Default` by returning a zero-length `Duration`. /// -/// [`Add`]: ../../std/ops/trait.Add.html -/// [`Sub`]: ../../std/ops/trait.Sub.html -/// [`ops`]: ../../std/ops/index.html +/// [`ops`]: crate::ops /// /// # Examples /// @@ -293,7 +291,7 @@ impl Duration { /// + duration.subsec_nanos() as f64 * 1e-9); /// ``` /// - /// [`subsec_nanos`]: #method.subsec_nanos + /// [`subsec_nanos`]: Duration::subsec_nanos #[stable(feature = "duration", since = "1.3.0")] #[rustc_const_stable(feature = "duration", since = "1.32.0")] #[inline] @@ -421,7 +419,7 @@ impl Duration { /// Checked `Duration` addition. Computes `self + other`, returning [`None`] /// if overflow occurred. /// - /// [`None`]: ../../std/option/enum.Option.html#variant.None + /// [`None`]: crate::option::Option::None /// /// # Examples /// @@ -457,7 +455,7 @@ impl Duration { /// Checked `Duration` subtraction. Computes `self - other`, returning [`None`] /// if the result would be negative or if overflow occurred. /// - /// [`None`]: ../../std/option/enum.Option.html#variant.None + /// [`None`]: crate::option::Option::None /// /// # Examples /// @@ -494,7 +492,7 @@ impl Duration { /// Checked `Duration` multiplication. Computes `self * other`, returning /// [`None`] if overflow occurred. /// - /// [`None`]: ../../std/option/enum.Option.html#variant.None + /// [`None`]: crate::option::Option::None /// /// # Examples /// @@ -526,7 +524,7 @@ impl Duration { /// Checked `Duration` division. Computes `self / other`, returning [`None`] /// if `other == 0`. /// - /// [`None`]: ../../std/option/enum.Option.html#variant.None + /// [`None`]: crate::option::Option::None /// /// # Examples /// From ce244210b16871e716539b1eb4de0f8390e4b732 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Sun, 9 Aug 2020 23:12:30 +0200 Subject: [PATCH 2/3] Remove liNone as it is in the prelude --- library/core/src/time.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/library/core/src/time.rs b/library/core/src/time.rs index 4d15a8d51af8a..cdbad0332ce2b 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -419,8 +419,6 @@ impl Duration { /// Checked `Duration` addition. Computes `self + other`, returning [`None`] /// if overflow occurred. /// - /// [`None`]: crate::option::Option::None - /// /// # Examples /// /// Basic usage: @@ -455,8 +453,6 @@ impl Duration { /// Checked `Duration` subtraction. Computes `self - other`, returning [`None`] /// if the result would be negative or if overflow occurred. /// - /// [`None`]: crate::option::Option::None - /// /// # Examples /// /// Basic usage: @@ -492,8 +488,6 @@ impl Duration { /// Checked `Duration` multiplication. Computes `self * other`, returning /// [`None`] if overflow occurred. /// - /// [`None`]: crate::option::Option::None - /// /// # Examples /// /// Basic usage: @@ -524,8 +518,6 @@ impl Duration { /// Checked `Duration` division. Computes `self / other`, returning [`None`] /// if `other == 0`. /// - /// [`None`]: crate::option::Option::None - /// /// # Examples /// /// Basic usage: From 9e71c13f28b8ca817f6629b1722ddbefd8c63076 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Sun, 9 Aug 2020 23:26:42 +0200 Subject: [PATCH 3/3] Add link for Duration Co-authored-by: Joshua Nelson --- library/core/src/time.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/time.rs b/library/core/src/time.rs index cdbad0332ce2b..5741f8a53b522 100644 --- a/library/core/src/time.rs +++ b/library/core/src/time.rs @@ -30,8 +30,8 @@ const MICROS_PER_SEC: u64 = 1_000_000; /// nanosecond-level precision, APIs binding a system timeout will typically round up /// the number of nanoseconds. /// -/// `Duration`s implement many common traits, including [`Add`], [`Sub`], and other -/// [`ops`] traits. It implements `Default` by returning a zero-length `Duration`. +/// [`Duration`]s implement many common traits, including [`Add`], [`Sub`], and other +/// [`ops`] traits. It implements [`Default`] by returning a zero-length `Duration`. /// /// [`ops`]: crate::ops ///