Skip to content

Commit 46c20c0

Browse files
authored
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.
1 parent da569fa commit 46c20c0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/libcore/option.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,7 @@ impl<T> Option<T> {
407407
}
408408

409409
/// Applies a function to the contained value (if any),
410-
/// or returns a [`default`][] (if not).
411-
///
412-
/// [`default`]: ../default/trait.Default.html#tymethod.default
410+
/// or returns the provided default (if not).
413411
///
414412
/// # Examples
415413
///
@@ -430,9 +428,7 @@ impl<T> Option<T> {
430428
}
431429

432430
/// Applies a function to the contained value (if any),
433-
/// or computes a [`default`][] (if not).
434-
///
435-
/// [`default`]: ../default/trait.Default.html#tymethod.default
431+
/// or computes a default (if not).
436432
///
437433
/// # Examples
438434
///
@@ -850,7 +846,7 @@ impl<T: Default> Option<T> {
850846
/// Returns the contained value or a default
851847
///
852848
/// Consumes the `self` argument then, if [`Some`], returns the contained
853-
/// value, otherwise if [`None`], returns the default value for that
849+
/// value, otherwise if [`None`], returns the [default value] for that
854850
/// type.
855851
///
856852
/// # Examples
@@ -872,6 +868,7 @@ impl<T: Default> Option<T> {
872868
///
873869
/// [`Some`]: #variant.Some
874870
/// [`None`]: #variant.None
871+
/// [default value]: ../default/trait.Default.html#tymethod.default
875872
/// [`parse`]: ../../std/primitive.str.html#method.parse
876873
/// [`FromStr`]: ../../std/str/trait.FromStr.html
877874
#[inline]

0 commit comments

Comments
 (0)