Skip to content

Commit 17a26ee

Browse files
Add missing urls in Option enum
1 parent 244f893 commit 17a26ee

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/libcore/option.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ impl<T> Option<T> {
219219
///
220220
/// # Examples
221221
///
222-
/// Convert an `Option<String>` into an `Option<usize>`, preserving the original.
222+
/// Convert an `Option<`[`String`]`>` into an `Option<`[`usize`]`>`, preserving the original.
223223
/// The [`map`] method takes the `self` argument by value, consuming the original,
224224
/// so this technique uses `as_ref` to first take an `Option` to a reference
225225
/// to the value inside the original.
226226
///
227227
/// [`map`]: enum.Option.html#method.map
228+
/// [`String`]: ../../std/string/struct.String.html
229+
/// [`usize`]: ../../std/primitive.usize.html
228230
///
229231
/// ```
230232
/// let num_as_str: Option<String> = Some("10".to_string());
@@ -271,9 +273,11 @@ impl<T> Option<T> {
271273
///
272274
/// # Panics
273275
///
274-
/// Panics if the value is a `None` with a custom panic message provided by
276+
/// Panics if the value is a [`None`] with a custom panic message provided by
275277
/// `msg`.
276278
///
279+
/// [`None`]: #variant.None
280+
///
277281
/// # Examples
278282
///
279283
/// ```
@@ -302,7 +306,9 @@ impl<T> Option<T> {
302306
///
303307
/// # Panics
304308
///
305-
/// Panics if the self value equals `None`.
309+
/// Panics if the self value equals [`None`].
310+
///
311+
/// [`None`]: #variant.None
306312
///
307313
/// # Examples
308314
///
@@ -367,7 +373,10 @@ impl<T> Option<T> {
367373
///
368374
/// # Examples
369375
///
370-
/// Convert an `Option<String>` into an `Option<usize>`, consuming the original:
376+
/// Convert an `Option<`[`String`]`>` into an `Option<`[`usize`]`>`, consuming the original:
377+
///
378+
/// [`String`]: ../../std/string/struct.String.html
379+
/// [`usize`]: ../../std/primitive.usize.html
371380
///
372381
/// ```
373382
/// let maybe_some_string = Some(String::from("Hello, World!"));

0 commit comments

Comments
 (0)