File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 6060//! the optional owned box, [`Option`]`<`[`Box<T>`]`>`.
6161//!
6262//! The following example uses [`Option`] to create an optional box of
63- //! [`i32`]. Notice that in order to use the inner [`i32`] value first the
63+ //! [`i32`]. Notice that in order to use the inner [`i32`] value first, the
6464//! `check_optional` function needs to use pattern matching to
6565//! determine whether the box has a value (i.e. it is [`Some(...)`][`Some`]) or
6666//! not ([`None`]).
7474//!
7575//! fn check_optional(optional: &Option<Box<i32>>) {
7676//! match *optional {
77- //! Some(ref p) => println!("have value {}", p),
78- //! None => println!("have no value"),
77+ //! Some(ref p) => println!("has value {}", p),
78+ //! None => println!("has no value"),
7979//! }
8080//! }
8181//! ```
You can’t perform that action at this time.
0 commit comments