From cb65b48c06406efd21c96372fff2840c957c8798 Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Thu, 10 Jun 2021 22:25:11 -0500 Subject: [PATCH 1/2] fix wording in option doc Fix some awkward wording in the `core::option` documentation in the "Options and pointers" section. --- library/core/src/option.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 4e7afca6a4930..0dd182203dfce 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -50,8 +50,8 @@ //! the optional owned box, [`Option`]`<`[`Box`]`>`. //! //! The following example uses [`Option`] to create an optional box of -//! [`i32`]. Notice that in order to use the inner [`i32`] value first, the -//! `check_optional` function needs to use pattern matching to +//! [`i32`]. Notice that in order to use the inner [`i32`] value, the +//! `check_optional` function first needs to use pattern matching to //! determine whether the box has a value (i.e., it is [`Some(...)`][`Some`]) or //! not ([`None`]). //! From 4763377a96691997e03e27f7b292e7dcd5e7a53d Mon Sep 17 00:00:00 2001 From: Taylor Yu Date: Thu, 10 Jun 2021 22:27:27 -0500 Subject: [PATCH 2/2] fix typo in option doc Fix a typo/missed replacement in the documentation for `impl From<&Option> for Option<&T>` in `core::option`. --- library/core/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 0dd182203dfce..aedfe88f68878 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1350,7 +1350,7 @@ impl<'a, T> From<&'a Option> for Option<&'a T> { /// /// 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 + /// so this technique uses `from` to first take an `Option` to a reference /// to the value inside the original. /// /// [`map`]: Option::map