Skip to content

Commit 9659c80

Browse files
authored
Rollup merge of #41749 - frewsxcv:option-simplify-types, r=GuillaumeGomez
Simplify types in `std::option` doc comment example. None
2 parents a9b0b5e + 7b94d6c commit 9659c80

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)