Skip to content

Commit 7b94d6c

Browse files
committed
Simplify types in std::option doc comment example.
1 parent b16c7a2 commit 7b94d6c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libcore/option.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@
6666
//! not ([`None`]).
6767
//!
6868
//! ```
69-
//! let optional: Option<Box<i32>> = None;
70-
//! check_optional(&optional);
69+
//! let optional = None;
70+
//! check_optional(optional);
7171
//!
72-
//! let optional: Option<Box<i32>> = Some(Box::new(9000));
73-
//! check_optional(&optional);
72+
//! let optional = Some(Box::new(9000));
73+
//! check_optional(optional);
7474
//!
75-
//! fn check_optional(optional: &Option<Box<i32>>) {
76-
//! match *optional {
75+
//! fn check_optional(optional: Option<Box<i32>>) {
76+
//! match optional {
7777
//! Some(ref p) => println!("has value {}", p),
7878
//! None => println!("has no value"),
7979
//! }

0 commit comments

Comments
 (0)