about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZachary Mayhew <mayhew.zachary2003@gmail.com>2022-11-26 15:41:48 -0800
committerZachary Mayhew <mayhew.zachary2003@gmail.com>2022-11-26 15:41:48 -0800
commit74e7709485c7597ff7446ac9b420153e22f834fc (patch)
treede55dac67f095b6b31b5b6ecf67c9d1096cc2e62
parent80a96467ec5675e9f69683b5c075a8b15950c341 (diff)
downloadrust-74e7709485c7597ff7446ac9b420153e22f834fc.tar.gz
rust-74e7709485c7597ff7446ac9b420153e22f834fc.zip
reword Option::as_ref and Option::map examples
-rw-r--r--library/core/src/option.rs12
1 files 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 @@ impl<T> Option<T> {
     ///
     /// # Examples
     ///
-    /// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, 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 <code>Option<[String]></code> as an <code>Option<[usize]></code>
+    /// 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 @@ impl<T> Option<T> {
     ///
     /// # Examples
     ///
-    /// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, consuming
-    /// the original:
+    /// Calculates the length of an <code>Option<[String]></code> as an
+    /// <code>Option<[usize]></code>, consuming the original:
     ///
     /// [String]: ../../std/string/struct.String.html "String"
     /// ```