From 74e7709485c7597ff7446ac9b420153e22f834fc Mon Sep 17 00:00:00 2001 From: Zachary Mayhew Date: Sat, 26 Nov 2022 15:41:48 -0800 Subject: [PATCH] reword Option::as_ref and Option::map examples --- library/core/src/option.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 505d964e518..6bfe34390cc 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -608,10 +608,10 @@ pub const fn is_none(&self) -> bool { /// /// # Examples /// - /// Converts an Option<[String]> into an Option<[usize]>, preserving - /// the original. The [`map`] method takes the `self` argument by value, consuming the original, - /// so this technique uses `as_ref` to first take an `Option` to a reference - /// to the value inside the original. + /// Calculates the length of an Option<[String]> as an Option<[usize]> + /// without moving the [`String`]. The [`map`] method takes the `self` argument by value, + /// consuming the original, so this technique uses `as_ref` to first take an `Option` to a + /// reference to the value inside the original. /// /// [`map`]: Option::map /// [String]: ../../std/string/struct.String.html "String" @@ -902,8 +902,8 @@ pub const fn unwrap_or_default(self) -> T /// /// # Examples /// - /// Converts an Option<[String]> into an Option<[usize]>, consuming - /// the original: + /// Calculates the length of an Option<[String]> as an + /// Option<[usize]>, consuming the original: /// /// [String]: ../../std/string/struct.String.html "String" /// ```