Skip to content

Commit

Permalink
Rollup merge of rust-lang#47497 - goffrie:patch-1, r=dtolnay
Browse files Browse the repository at this point in the history
Remove incorrect `Default::default` links, add a new one

`map_or` and `map_or_else` don't use `Default::default`, but `unwrap_or_default` does.
  • Loading branch information
kennytm authored Jan 17, 2018
2 parents 5e1f442 + 46c20c0 commit a588dcf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ impl<T> Option<T> {
}

/// Applies a function to the contained value (if any),
/// or returns a [`default`][] (if not).
///
/// [`default`]: ../default/trait.Default.html#tymethod.default
/// or returns the provided default (if not).
///
/// # Examples
///
Expand All @@ -430,9 +428,7 @@ impl<T> Option<T> {
}

/// Applies a function to the contained value (if any),
/// or computes a [`default`][] (if not).
///
/// [`default`]: ../default/trait.Default.html#tymethod.default
/// or computes a default (if not).
///
/// # Examples
///
Expand Down Expand Up @@ -850,7 +846,7 @@ impl<T: Default> Option<T> {
/// Returns the contained value or a default
///
/// Consumes the `self` argument then, if [`Some`], returns the contained
/// value, otherwise if [`None`], returns the default value for that
/// value, otherwise if [`None`], returns the [default value] for that
/// type.
///
/// # Examples
Expand All @@ -872,6 +868,7 @@ impl<T: Default> Option<T> {
///
/// [`Some`]: #variant.Some
/// [`None`]: #variant.None
/// [default value]: ../default/trait.Default.html#tymethod.default
/// [`parse`]: ../../std/primitive.str.html#method.parse
/// [`FromStr`]: ../../std/str/trait.FromStr.html
#[inline]
Expand Down

0 comments on commit a588dcf

Please sign in to comment.