Skip to content

Commit

Permalink
adds links to methods, removes trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Strong committed Dec 7, 2017
1 parent 9307917 commit 5847d0b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
15 changes: 10 additions & 5 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,11 @@ impl<T> Option<T> {

/// Returns the contained value or a default.
///
/// Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use `unwrap_or_else`,
/// which is lazily evaluated.
/// Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use [`unwrap_or_else`],
/// which is lazily evaluated.
///
/// [`unwrap_or_else`]: #method.unwrap_or_else
///
/// # Examples
///
Expand Down Expand Up @@ -456,14 +458,15 @@ impl<T> Option<T> {
/// [`Ok(v)`] and [`None`] to [`Err(err)`].
///
/// Arguments passed to `ok_or` are eagerly evaluated; if you are passing the
/// result of a function call, it is recommended to use `ok_or_else`, which is
/// result of a function call, it is recommended to use [`ok_or_else`], which is
/// lazily evaluated.
///
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
/// [`Ok(v)`]: ../../std/result/enum.Result.html#variant.Ok
/// [`Err(err)`]: ../../std/result/enum.Result.html#variant.Err
/// [`None`]: #variant.None
/// [`Some(v)`]: #variant.Some
/// [`ok_or_else`]: #method.ok_or_else
///
/// # Examples
///
Expand Down Expand Up @@ -618,9 +621,11 @@ impl<T> Option<T> {
/// Returns the option if it contains a value, otherwise returns `optb`.
///
/// Arguments passed to `or` are eagerly evaluated; if you are passing the
/// result of a function call, it is recommended to use `or_else`, which is
/// result of a function call, it is recommended to use [`or_else`], which is
/// lazily evaluated.
///
/// [`or_else`]: #method.or_else
///
/// # Examples
///
/// ```
Expand Down
10 changes: 6 additions & 4 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,12 @@ impl<T, E> Result<T, E> {
/// Returns `res` if the result is [`Err`], otherwise returns the [`Ok`] value of `self`.
///
/// Arguments passed to `or` are eagerly evaluated; if you are passing the
/// result of a function call, it is recommended to use `or_else`, which is
/// result of a function call, it is recommended to use [`or_else`], which is
/// lazily evaluated.
///
/// [`Ok`]: enum.Result.html#variant.Ok
/// [`Err`]: enum.Result.html#variant.Err
/// [`or_else`]: #method.or_else
///
/// # Examples
///
Expand Down Expand Up @@ -694,12 +695,13 @@ impl<T, E> Result<T, E> {
/// Unwraps a result, yielding the content of an [`Ok`].
/// Else, it returns `optb`.
///
/// Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use `unwrap_or_else`,
/// which is lazily evaluated.
/// Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing
/// the result of a function call, it is recommended to use [`unwrap_or_else`],
/// which is lazily evaluated.
///
/// [`Ok`]: enum.Result.html#variant.Ok
/// [`Err`]: enum.Result.html#variant.Err
/// [`unwrap_or_else`]: #method.unwrap_or_else
///
/// # Examples
///
Expand Down

0 comments on commit 5847d0b

Please sign in to comment.