Skip to content

Commit 192f6dc

Browse files
authored
Rollup merge of #65600 - integer32llc:bye-bye-ref, r=Centril
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! There might be more like this, but I don't have a checkout on my computer right this second and I'm on slow wifi and GitHub search isn't powerful enough and that's my story.
2 parents eba24f0 + 4ea1a19 commit 192f6dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: 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)