diff options
| author | Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com> | 2019-10-19 11:20:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-19 11:20:05 -0400 |
| commit | 4ea1a1983e228959c72e3e121c56808160ef795d (patch) | |
| tree | 0f5ee9c8b1b20fe1cc855705b951c4f2cffb6674 | |
| parent | e5b8c118a38e8f3319813de56386bf43751582d7 (diff) | |
| download | rust-4ea1a1983e228959c72e3e121c56808160ef795d.tar.gz rust-4ea1a1983e228959c72e3e121c56808160ef795d.zip | |
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!
| -rw-r--r-- | src/libcore/option.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 47e3a0d2167..09d4076c7fb 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -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); //! } //! |
