@@ -219,12 +219,14 @@ impl<T> Option<T> {
219
219
///
220
220
/// # Examples
221
221
///
222
- /// Convert an `Option<String>` into an `Option<usize>`, preserving the original.
222
+ /// Convert an `Option<`[` String`]` >` into an `Option<`[` usize`]` >`, preserving the original.
223
223
/// The [`map`] method takes the `self` argument by value, consuming the original,
224
224
/// so this technique uses `as_ref` to first take an `Option` to a reference
225
225
/// to the value inside the original.
226
226
///
227
227
/// [`map`]: enum.Option.html#method.map
228
+ /// [`String`]: ../../std/string/struct.String.html
229
+ /// [`usize`]: ../../std/primitive.usize.html
228
230
///
229
231
/// ```
230
232
/// let num_as_str: Option<String> = Some("10".to_string());
@@ -271,9 +273,11 @@ impl<T> Option<T> {
271
273
///
272
274
/// # Panics
273
275
///
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
275
277
/// `msg`.
276
278
///
279
+ /// [`None`]: #variant.None
280
+ ///
277
281
/// # Examples
278
282
///
279
283
/// ```
@@ -302,7 +306,9 @@ impl<T> Option<T> {
302
306
///
303
307
/// # Panics
304
308
///
305
- /// Panics if the self value equals `None`.
309
+ /// Panics if the self value equals [`None`].
310
+ ///
311
+ /// [`None`]: #variant.None
306
312
///
307
313
/// # Examples
308
314
///
@@ -367,7 +373,10 @@ impl<T> Option<T> {
367
373
///
368
374
/// # Examples
369
375
///
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
371
380
///
372
381
/// ```
373
382
/// let maybe_some_string = Some(String::from("Hello, World!"));
0 commit comments