Skip to content

Commit 74e7709

Browse files
committed
reword Option::as_ref and Option::map examples
1 parent 80a9646 commit 74e7709

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

library/core/src/option.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,10 @@ impl<T> Option<T> {
608608
///
609609
/// # Examples
610610
///
611-
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, preserving
612-
/// the original. The [`map`] method takes the `self` argument by value, consuming the original,
613-
/// so this technique uses `as_ref` to first take an `Option` to a reference
614-
/// to the value inside the original.
611+
/// Calculates the length of an <code>Option<[String]></code> as an <code>Option<[usize]></code>
612+
/// without moving the [`String`]. The [`map`] method takes the `self` argument by value,
613+
/// consuming the original, so this technique uses `as_ref` to first take an `Option` to a
614+
/// reference to the value inside the original.
615615
///
616616
/// [`map`]: Option::map
617617
/// [String]: ../../std/string/struct.String.html "String"
@@ -902,8 +902,8 @@ impl<T> Option<T> {
902902
///
903903
/// # Examples
904904
///
905-
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, consuming
906-
/// the original:
905+
/// Calculates the length of an <code>Option<[String]></code> as an
906+
/// <code>Option<[usize]></code>, consuming the original:
907907
///
908908
/// [String]: ../../std/string/struct.String.html "String"
909909
/// ```

0 commit comments

Comments
 (0)