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));