]> git.lizzy.rs Git - rust.git/commitdiff
Add missing urls in Option enum
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 20 Mar 2017 14:06:05 +0000 (15:06 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 20 Mar 2017 14:09:02 +0000 (15:09 +0100)
src/libcore/option.rs

index 9df8350d90ffdc8cb864ed4899b57018e390139f..d997f3592fd76d45842af82c89dede308fa08d68 100644 (file)
@@ -219,12 +219,14 @@ pub fn is_none(&self) -> bool {
     ///
     /// # Examples
     ///
-    /// Convert an `Option<String>` into an `Option<usize>`, preserving the original.
+    /// Convert an `Option<`[`String`]`>` into an `Option<`[`usize`]`>`, preserving the original.
     /// The [`map`] method takes the `self` argument by value, consuming the original,
     /// so this technique uses `as_ref` to first take an `Option` to a reference
     /// to the value inside the original.
     ///
     /// [`map`]: enum.Option.html#method.map
+    /// [`String`]: ../../std/string/struct.String.html
+    /// [`usize`]: ../../std/primitive.usize.html
     ///
     /// ```
     /// let num_as_str: Option<String> = Some("10".to_string());
@@ -271,9 +273,11 @@ pub fn as_mut(&mut self) -> Option<&mut T> {
     ///
     /// # Panics
     ///
-    /// Panics if the value is a `None` with a custom panic message provided by
+    /// Panics if the value is a [`None`] with a custom panic message provided by
     /// `msg`.
     ///
+    /// [`None`]: #variant.None
+    ///
     /// # Examples
     ///
     /// ```
@@ -302,7 +306,9 @@ pub fn expect(self, msg: &str) -> T {
     ///
     /// # Panics
     ///
-    /// Panics if the self value equals `None`.
+    /// Panics if the self value equals [`None`].
+    ///
+    /// [`None`]: #variant.None
     ///
     /// # Examples
     ///
@@ -367,7 +373,10 @@ pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
     ///
     /// # Examples
     ///
-    /// Convert an `Option<String>` into an `Option<usize>`, consuming the original:
+    /// Convert an `Option<`[`String`]`>` into an `Option<`[`usize`]`>`, consuming the original:
+    ///
+    /// [`String`]: ../../std/string/struct.String.html
+    /// [`usize`]: ../../std/primitive.usize.html
     ///
     /// ```
     /// let maybe_some_string = Some(String::from("Hello, World!"));