reword Option::as_ref and Option::map examples
This commit is contained in:
parent
80a96467ec
commit
74e7709485
@ -608,10 +608,10 @@ pub const fn is_none(&self) -> bool {
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, preserving
|
/// Calculates the length of an <code>Option<[String]></code> as an <code>Option<[usize]></code>
|
||||||
/// the original. The [`map`] method takes the `self` argument by value, consuming the original,
|
/// without moving the [`String`]. The [`map`] method takes the `self` argument by value,
|
||||||
/// so this technique uses `as_ref` to first take an `Option` to a reference
|
/// consuming the original, so this technique uses `as_ref` to first take an `Option` to a
|
||||||
/// to the value inside the original.
|
/// reference to the value inside the original.
|
||||||
///
|
///
|
||||||
/// [`map`]: Option::map
|
/// [`map`]: Option::map
|
||||||
/// [String]: ../../std/string/struct.String.html "String"
|
/// [String]: ../../std/string/struct.String.html "String"
|
||||||
@ -902,8 +902,8 @@ pub const fn unwrap_or_default(self) -> T
|
|||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, consuming
|
/// Calculates the length of an <code>Option<[String]></code> as an
|
||||||
/// the original:
|
/// <code>Option<[usize]></code>, consuming the original:
|
||||||
///
|
///
|
||||||
/// [String]: ../../std/string/struct.String.html "String"
|
/// [String]: ../../std/string/struct.String.html "String"
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user