diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-20 23:45:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-20 23:45:02 -0400 |
| commit | bf3f77b716562b1e98251fca35d39ee7da7cbeac (patch) | |
| tree | 52920958de813b7ec44fc223893afd9763ce7b45 | |
| parent | d0c04fbacaf44fd176ed1b88d2389cde67a7476e (diff) | |
| parent | 17a26ee2758ddd371556f9cae6ebd407eeb59b89 (diff) | |
| download | rust-bf3f77b716562b1e98251fca35d39ee7da7cbeac.tar.gz rust-bf3f77b716562b1e98251fca35d39ee7da7cbeac.zip | |
Rollup merge of #40671 - GuillaumeGomez:options-urls, r=frewsxcv
Add missing urls in Option enum r? @rust-lang/docs
| -rw-r--r-- | src/libcore/option.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 9df8350d90f..d997f3592fd 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -219,12 +219,14 @@ impl<T> Option<T> { /// /// # 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 @@ impl<T> Option<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 @@ impl<T> Option<T> { /// /// # Panics /// - /// Panics if the self value equals `None`. + /// Panics if the self value equals [`None`]. + /// + /// [`None`]: #variant.None /// /// # Examples /// @@ -367,7 +373,10 @@ impl<T> Option<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!")); |
