doc: minor Option improvements

This commit is contained in:
Tshepang Lekhonkhobe 2017-01-30 08:39:03 +02:00
parent 45b273af4a
commit 4814fa488e

View File

@ -60,7 +60,7 @@
//! the optional owned box, [`Option`]`<`[`Box<T>`]`>`. //! the optional owned box, [`Option`]`<`[`Box<T>`]`>`.
//! //!
//! The following example uses [`Option`] to create an optional box of //! The following example uses [`Option`] to create an optional box of
//! [`i32`]. Notice that in order to use the inner [`i32`] value first the //! [`i32`]. Notice that in order to use the inner [`i32`] value first, the
//! `check_optional` function needs to use pattern matching to //! `check_optional` function needs to use pattern matching to
//! determine whether the box has a value (i.e. it is [`Some(...)`][`Some`]) or //! determine whether the box has a value (i.e. it is [`Some(...)`][`Some`]) or
//! not ([`None`]). //! not ([`None`]).
@ -74,8 +74,8 @@
//! //!
//! fn check_optional(optional: &Option<Box<i32>>) { //! fn check_optional(optional: &Option<Box<i32>>) {
//! match *optional { //! match *optional {
//! Some(ref p) => println!("have value {}", p), //! Some(ref p) => println!("has value {}", p),
//! None => println!("have no value"), //! None => println!("has no value"),
//! } //! }
//! } //! }
//! ``` //! ```