Skip to content

Commit b4f416d

Browse files
committed
docs: make the description of Result::map_or more clear
1 parent 1b521f5 commit b4f416d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libcore/result.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -521,14 +521,16 @@ impl<T, E> Result<T, E> {
521521
}
522522
}
523523

524-
/// Applies a function to the contained value (if any),
525-
/// or returns the provided default (if not).
524+
/// Applies a function to the contained value (if [`Ok`]),
525+
/// or returns the provided default (if [`Err`]).
526526
///
527527
/// Arguments passed to `map_or` are eagerly evaluated; if you are passing
528528
/// the result of a function call, it is recommended to use [`map_or_else`],
529529
/// which is lazily evaluated.
530530
///
531531
/// [`map_or_else`]: #method.map_or_else
532+
/// [`Ok`]: enum.Result.html#variant.Ok
533+
/// [`Err`]: enum.Result.html#variant.Err
532534
///
533535
/// # Examples
534536
///

0 commit comments

Comments
 (0)