diff options
| author | kennytm <kennytm@gmail.com> | 2018-01-18 01:57:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-18 01:57:28 +0800 |
| commit | a588dcff2819bb96eda68c1c59ac8dd0912cfa59 (patch) | |
| tree | 9f31b4331c5aa123c2a1e6d3a0d0a6f10604273a /src/libcore | |
| parent | 5e1f442ba1c440b08531d41aebaf4f4bc41c9c8f (diff) | |
| parent | 46c20c099051fe6f20a963913b2afa3d1a8414ea (diff) | |
| download | rust-a588dcff2819bb96eda68c1c59ac8dd0912cfa59.tar.gz rust-a588dcff2819bb96eda68c1c59ac8dd0912cfa59.zip | |
Rollup merge of #47497 - goffrie:patch-1, r=dtolnay
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.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/option.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index d8f3ec38cf3..15181dab853 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -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 /// @@ -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 /// @@ -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 @@ -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] |
