Skip to content

Commit 4ea1a19

Browse files
Remove unneeded ref from docs
Will reduce confusion like in https://users.rust-lang.org/t/help-understanding-the-ref-t-syntax/33779 since match ergonomics means you (almost) never have to say `ref` anymore!
1 parent e5b8c11 commit 4ea1a19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/option.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
//!
6565
//! fn check_optional(optional: Option<Box<i32>>) {
6666
//! match optional {
67-
//! Some(ref p) => println!("has value {}", p),
67+
//! Some(p) => println!("has value {}", p),
6868
//! None => println!("has no value"),
6969
//! }
7070
//! }
@@ -83,7 +83,7 @@
8383
//! let msg = Some("howdy");
8484
//!
8585
//! // Take a reference to the contained string
86-
//! if let Some(ref m) = msg {
86+
//! if let Some(m) = &msg {
8787
//! println!("{}", *m);
8888
//! }
8989
//!

0 commit comments

Comments
 (0)