]> git.lizzy.rs Git - rust.git/commitdiff
Simplify types in `std::option` doc comment example.
authorCorey Farwell <coreyf@rwell.org>
Thu, 4 May 2017 15:53:24 +0000 (11:53 -0400)
committerCorey Farwell <coreyf@rwell.org>
Thu, 4 May 2017 15:53:24 +0000 (11:53 -0400)
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"),
 //!     }