about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-05-04 11:53:24 -0400
committerCorey Farwell <coreyf@rwell.org>2017-05-04 11:53:24 -0400
commit7b94d6cf19d1a9af23483d366217b010ed66b78d (patch)
tree4863350e309ddbec0c97419bf97152a5f5a24888
parentb16c7a235fa0f57fed6b7ec13ffd3cff1bcdd9ad (diff)
downloadrust-7b94d6cf19d1a9af23483d366217b010ed66b78d.tar.gz
rust-7b94d6cf19d1a9af23483d366217b010ed66b78d.zip
Simplify types in `std::option` doc comment example.
-rw-r--r--src/libcore/option.rs12
1 files changed, 6 insertions, 6 deletions
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<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"),
 //!     }