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!
This commit is contained in:
parent
e5b8c118a3
commit
4ea1a1983e
@ -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"),
|
||||
//! }
|
||||
//! }
|
||||
@ -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);
|
||||
//! }
|
||||
//!
|
||||
|
Loading…
x
Reference in New Issue
Block a user