Simplify types in std::option doc comment example.

This commit is contained in:
Corey Farwell 2017-05-04 11:53:24 -04:00
parent b16c7a235f
commit 7b94d6cf19

View File

@ -66,14 +66,14 @@
//! not ([`None`]). //! not ([`None`]).
//! //!
//! ``` //! ```
//! let optional: Option<Box<i32>> = None; //! let optional = None;
//! check_optional(&optional); //! check_optional(optional);
//! //!
//! let optional: Option<Box<i32>> = Some(Box::new(9000)); //! let optional = Some(Box::new(9000));
//! check_optional(&optional); //! check_optional(optional);
//! //!
//! fn check_optional(optional: &Option<Box<i32>>) { //! fn check_optional(optional: Option<Box<i32>>) {
//! match *optional { //! match optional {
//! Some(ref p) => println!("has value {}", p), //! Some(ref p) => println!("has value {}", p),
//! None => println!("has no value"), //! None => println!("has no value"),
//! } //! }