Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
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!
  • Loading branch information
carols10cents authored Oct 19, 2019
commit 4ea1a1983e228959c72e3e121c56808160ef795d
4 changes: 2 additions & 2 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
//!
//! fn check_optional(optional: Option<Box<i32>>) {
//! match optional {
//! Some(ref p) => println!("has value {}", p),
//! Some(p) => println!("has value {}", p),
//! None => println!("has no value"),
//! }
//! }
Expand All @@ -83,7 +83,7 @@
//! let msg = Some("howdy");
//!
//! // Take a reference to the contained string
//! if let Some(ref m) = msg {
//! if let Some(m) = &msg {
//! println!("{}", *m);
//! }
//!
Expand Down