From 804f024edab8b85f276a9a3fbfa23215a4688328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Ochagav=C3=ADa?= Date: Wed, 16 Sep 2015 10:17:38 +0200 Subject: [PATCH] Simplify sample code for {Option, Result}::iter_mut Fixes #28431 --- src/libcore/option.rs | 2 +- src/libcore/result.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index a539ef81db8..d1bb65d2290 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -541,7 +541,7 @@ pub fn iter(&self) -> Iter { /// ``` /// let mut x = Some(4); /// match x.iter_mut().next() { - /// Some(&mut ref mut v) => *v = 42, + /// Some(v) => *v = 42, /// None => {}, /// } /// assert_eq!(x, Some(42)); diff --git a/src/libcore/result.rs b/src/libcore/result.rs index e9a67196751..fe0fdb5baa5 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -538,7 +538,7 @@ pub fn iter(&self) -> Iter { /// ``` /// let mut x: Result = Ok(7); /// match x.iter_mut().next() { - /// Some(&mut ref mut x) => *x = 40, + /// Some(v) => *v = 40, /// None => {}, /// } /// assert_eq!(x, Ok(40));