From: Corey Farwell Date: Thu, 4 May 2017 15:53:24 +0000 (-0400) Subject: Simplify types in `std::option` doc comment example. X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=7b94d6cf19d1a9af23483d366217b010ed66b78d;p=rust.git Simplify types in `std::option` doc comment example. --- diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 1a48f277625..515f49d6f0b 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -66,14 +66,14 @@ //! not ([`None`]). //! //! ``` -//! let optional: Option> = None; -//! check_optional(&optional); +//! let optional = None; +//! check_optional(optional); //! -//! let optional: Option> = Some(Box::new(9000)); -//! check_optional(&optional); +//! let optional = Some(Box::new(9000)); +//! check_optional(optional); //! -//! fn check_optional(optional: &Option>) { -//! match *optional { +//! fn check_optional(optional: Option>) { +//! match optional { //! Some(ref p) => println!("has value {}", p), //! None => println!("has no value"), //! }