Rollup merge of #41749 - frewsxcv:option-simplify-types, r=GuillaumeGomez

Simplify types in `std::option` doc comment example.

None
This commit is contained in:
Corey Farwell 2017-05-04 21:35:30 -04:00 committed by GitHub
commit 9659c806b8

View File

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