]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #41749 - frewsxcv:option-simplify-types, r=GuillaumeGomez
authorCorey Farwell <coreyf@rwell.org>
Fri, 5 May 2017 01:35:30 +0000 (21:35 -0400)
committerGitHub <noreply@github.com>
Fri, 5 May 2017 01:35:30 +0000 (21:35 -0400)
Simplify types in `std::option` doc comment example.

None

src/libcore/option.rs

index 1a48f27762580e38047b87ad5468adb21b58114f..515f49d6f0bddc35aa41352a8675e3c8aa819572 100644 (file)
 //! 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"),
 //!     }